Fix flaky test_self_e2e_pd_perturb (#27426)

This commit is contained in:
fzyzcjy
2026-06-06 19:31:08 +08:00
committed by GitHub
parent 9a48bf75f5
commit 99cf0a4399
2 changed files with 19 additions and 2 deletions
@@ -37,7 +37,14 @@ class _PDPerturbBase(CanaryPDFixture):
) -> None:
# send_parallel_short_requests defaults to max_new_tokens=100 so D-side runs
# decode forwards that exercise canary verify on the transferred prefix.
self.send_parallel_short_requests(n=4)
#
# distinct_prompts is required for the violation to surface reliably:
# with a shared prompt, P-side radix caching rewrites each request's
# req_to_token row to the first-inserted (canonical) copy's slots in
# cache_unfinished_req BEFORE send_kv_chunk snapshots the indices, so a
# flip on a deduped duplicate slot is freed untransferred and never
# re-verified on either side.
self.send_parallel_short_requests(n=4, distinct_prompts=True)
# D-side: first decode forward re-verifies the transferred prefix slots,
# so the flip MUST surface as real_kv_hash violation.
self.assert_per_forward_violation_reported(