Skip to content

test(dashboard): wait on signals in the agent-switch publish test - #19506

Merged
bolichen97 merged 1 commit into
mainfrom
fix/18960-slot-switch-cancel
Oct 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/18960-slot-switch-cancel

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: test_agent_and_kind_are_not_published_separately passes on a slow Windows runner instead of failing at random.

On Windows CI the test fails with CancelledError / TimeoutError at asyncio.wait_for(entered_resolution.wait(), timeout=1). Linux on the same head is green.

Why it matters

Every PR whose Windows backend shard picks up this test can go red for no reason. That costs reruns and hides real failures.

Not a goal

  • No change to the agent-switch handler.
  • No change to any other test in the file.

What changed (motivation approach change)

The test waited at most 1 s for the handler to reach the stubbed warm-up, then 1 s more for the response.

Before the warm-up the handler does real off-loop reads of the session record. On a busy Windows runner those can take longer than 1 s, so the wait ran out and the request was cancelled.

Both waits use await_until from kiro_crew.testing.wait: it awaits the same event and task, bounded only by the lost-run limit (half the test timeout), and fails by name. test/wait_discipline_baseline.txt drops this file from 3 to 1 short fixed waits.

Backwards compatibility

Compatible: test-only change.

Removes nothing: only two waits in one test change shape; no product code is touched.

Tests

test_agent_and_kind_are_not_published_separately keeps its assertions: a sender crossing resolution sees the old agent and kind, then the new pair.

Determinism proof (Windows, Python 3.12):

Run Parent 63c155a582 Fix
1.5 s delay injected into the pre-warm session read, 3 runs 3 failed, TimeoutError 3 passed
3 s delay injected, 5 runs - 5 passed
200 repeats, one process - 200 passed
whole file, 3 shuffled orders (seeds 11, 22, 33) - 99 passed each

Manual verification

N/A - unit coverage sufficient; the change is inside one test.

Related Issues

Closes #18960

Pattern harvest

Not generalizable: the rule already exists (testing-conventions D1, enforced by test/test_wait_discipline_ratchet.py); this lowers one more file's count.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision d2c051729328c84d4df74d4764485e3a7a0c700b ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision d2c051729328c84d4df74d4764485e3a7a0c700b touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of d2c051729328c84d4df74d4764485e3a7a0c700b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] d2c0517

Description read

[DESCRIPTION-READ] 176853066eb7b935067d8581330264558fd173327468472c02765f96be03294f

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed d2c051729328c84d4df74d4764485e3a7a0c700b — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d2c0517

Verdict parsed from the review's SHA-scoped output markers for commit d2c051729328c84d4df74d4764485e3a7a0c700b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d2c051729328c84d4df74d4764485e3a7a0c700b: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of d2c051729328c84d4df74d4764485e3a7a0c700b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d2c0517

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d2c051729328c84d4df74d4764485e3a7a0c700b: <one-sentence reason>

@bolichen97

Copy link
Copy Markdown
Contributor Author

The red Backend Tests (3.12, 2) / Backend Tests (Windows) (2) (and the downstream Coverage Gate) are test/test_wait_discipline_ratchet.py::test_no_file_gains_a_short_fixed_wait, which is red on main itself: it names test/test_surface_deny_notice_sites.py and test/test_webhook_permission_requests.py, which this PR does not touch, and it reproduces on a clean origin/main checkout. Fixes are open in #19495 and #19512; this PR waits for one of them to land, then re-runs.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@bolichen97
bolichen97 force-pushed the fix/18960-slot-switch-cancel branch from b71770b to e00d7a3 Compare October 12, 2026 19:39
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main 65df088, which carries #19495 (the wait-discipline ratchet fix behind the shard-2 reds). test_wait_discipline_ratchet.py and test_chat_slot_switch_atomicity.py pass locally on the new head e00d7a3; CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 12, 2026
@bolichen97
bolichen97 force-pushed the fix/18960-slot-switch-cancel branch from e00d7a3 to d2c0517 Compare October 12, 2026 21:04
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/wait_discipline_baseline.txt since this head went green (65df088 -> ebe8a18); CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Oct 12, 2026
@bolichen97
bolichen97 merged commit 5c59f0d into main Oct 12, 2026
102 checks passed
@bolichen97
bolichen97 deleted the fix/18960-slot-switch-cancel branch October 12, 2026 23:35
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky on Windows: test_chat_slot_switch_atomicity::TestLinkedSlotSessionKey::test_agent_and_kind_are_not_published_separately (CancelledError)

2 participants