Skip to content

[Bugfix][TENT] Stabilize queued-request timeout regression test - #5917

Closed
zhou-yuhan wants to merge 3 commits into
kvcache-ai:mainfrom
zhou-yuhan:yuhan/tent-wait-transfer-timeout-test-fix
Closed

zhou-yuhan wants to merge 3 commits into
kvcache-ai:mainfrom
zhou-yuhan:yuhan/tent-wait-transfer-timeout-test-fix

Conversation

@zhou-yuhan

@zhou-yuhan zhou-yuhan commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Fix TENT RuntimeQueueDispatch.TimeoutDoesNotDispatchQueuedRequestsOfBatch test flake.

Motivation

RuntimeQueueDispatch.TimeoutDoesNotDispatchQueuedRequestsOfBatch failed in #5879 CI. The test makes the first fake-transport poll sleep 5 ms and return PENDING, expecting waitTransfer(..., 1) to time out and cancel the queued second request before polling can free the dispatch window.

However, enabling the runtime queue also starts ProgressWorker, and submission wakes it immediately. The background worker can consume that first poll, or complete the first request before the waiter cancels the queue. Subsequent polls then dispatch and complete the second request: submissions become 2 instead of 1, and its status is COMPLETED instead of CANCELED. The test assumes a polling order that it does not enforce.

Reproduced on upstream main 47efddf2, including merged #5879:

Scheduling Failed / repetitions
Unmodified test, natural scheduling 1 / 1000
Diagnostic copy, synchronized background-first poll 200 / 200

The controlled reproduction uses a test-only promise/future, with production code unchanged.

Design & Modification

  • Capture the waiter's thread ID in this case's status factory. Background polls return PENDING without consuming the counter; only the waiter executes the slow first poll and subsequent completion.
  • Keep the worker enabled and retain every assertion, timeout and delay.

Validation

Full local TENT CTest matrix, using CI's test selections (counts are CTest targets):

Profile Passed / total
cuda-off 67 / 67
cuda-off-metrics-on 67 / 67
ub-mock 71 / 71
memfabric-mock (CI-selected transport test) 1 / 1
  • Fixed case: 1000/1000 pass; synchronized background-first schedule: 200/200 pass, versus 200/200 failures without the fix.
  • All 24 cases in the affected executable, shuffled for 50 repetitions: 1200/1200 pass.
  • Regression sensitivity: deliberately moving cancelQueuedOwners() after getTransferStatus() still triggers the original assertions in 20/20 runs. The fix preserves the cancellation-before-refill check, not just a green result.
  • Scoped pre-commit and ./scripts/code_format.sh checks pass. Scheduling probes and the intentional production mutant are diagnostic copies only; neither is part of this PR.

Suggested Merge Priority

  • P2 — Normal: Fix an existing flaky CI regression test.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • CI/CD

Type of Change

  • Bug fix

Checklist

  • Every contributed commit includes the human author's Signed-off-by trailer certifying the DCO.
  • I have performed a self-review of my own code.
  • I have formatted the change using ./scripts/code_format.sh.
  • Scoped pre-commit checks pass.
  • Documentation is updated where applicable; no public API changes.
  • The existing regression test is updated and its failure sensitivity is checked.
  • For changes >500 LOC: I have filed an RFC issue (not applicable).

AI Assistance Disclosure

  • AI tools were used: Codex

Keep background status polls pending in this case’s fake transport so
only the waitTransfer caller consumes the slow first poll and drives
completion. Preserve the cancellation-before-refill assertions without
changing production behavior.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Yuhan Zhou <zhouyuhan_@outlook.com>
@github-actions github-actions Bot added Transfer Engine size/S 0-99 changed lines (additions + deletions) labels Nov 27, 2026
Include the upstream XPU CI contract and inventory repair (kvcache-ai#5920).
Keep the queued-request timeout regression fix unchanged.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Yuhan Zhou <zhouyuhan_@outlook.com>
@zhou-yuhan

Copy link
Copy Markdown
Contributor Author

CI is blocked by rocm wheel build error fixed in #5926, which should be merged first.

Include the upstream ROCm wheel linker repair (kvcache-ai#5926).
Keep the queued-request timeout regression test fix unchanged.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Yuhan Zhou <zhouyuhan_@outlook.com>
@zhou-yuhan

Copy link
Copy Markdown
Contributor Author

@staryxchen This small fix stabilizes CI.

@zhou-yuhan

Copy link
Copy Markdown
Contributor Author

#5514 already solves this with the same method.

@zhou-yuhan zhou-yuhan closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S 0-99 changed lines (additions + deletions) Transfer Engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant