Repository navigation
🐛 fix(kubejob): make TestRunContextTimeoutDeletesTheJob deterministic - #14512
Conversation
The 40ms deadline could expire before the Job was created on a slow runner, so Run returned without a Job to delete. End the context from the fake API on the first Job GET instead. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Root cause: the test used a fixed 40ms context deadline. On a slow CI runner it could expire before the Job POST completed, so Run returned before any Job existed to delete and the delete assertion failed.
Fix: the fake API now has an onJobGet hook; the test cancels the context from it on the first Job GET, so the cancel is synchronized with Run being mid-poll. No sleeps, no production change (Run deletes synchronously before returning).
Closes #14485
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88