Repository navigation
test(knowledge): wait on the committed audit instead of a fixed sleep - #13737
Merged
iamwhatever merged 1 commit intoSep 26, 2026
Merged
Conversation
Contributor
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS If the mid-write [DESIGN-REVIEWED] a5aa826 |
Contributor
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Contributor
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
This was referenced Sep 25, 2026
jeeshofone
force-pushed
the
fix/flake-committed-audit-cancel
branch
from
September 26, 2026 00:01
3287f94 to
041daee
Compare
jeeshofone
force-pushed
the
fix/flake-committed-audit-cancel
branch
from
September 26, 2026 03:19
041daee to
a51663d
Compare
The cancel test gave the worker thread a fixed 0.4s to finish its 0.2s write and audit. On a loaded Windows runner the worker is not always scheduled inside that window, so the assertion read [] before the audit arrived. Hold the fake write until after the cancellation and wait on an event the audit sets, with a 10s bound. Fixes kirodotdev#13730
jeeshofone
force-pushed
the
fix/flake-committed-audit-cancel
branch
from
September 26, 2026 03:55
a51663d to
a5aa826
Compare
iamwhatever
approved these changes
Sep 26, 2026
iamwhatever
enabled auto-merge (squash)
September 26, 2026 06:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Motivation
test_cancelling_the_caller_cannot_drop_a_committed_auditfails intermittently on Windows shard 1 withassert [] == ['item.update'](#13730). It hit #13538 and #12605, neither of which touches knowledge handlers.Why it matters
A shared flake on main turns unrelated PRs red and costs each one a fresh head. The assertion also reads like a dropped audit, the exact defect
_audited_writeexists to prevent, so a reader can mistake the flake for a regression.What changed (motivation → approach → change)
Test-only.
src/kiro_crew/dashboard/handlers/knowledge.pyis unchanged: it already runs the write and_sel_login one worker take.Backwards compatibility
No runtime change.
Tests
694f61983e5e5045326f001940effb726001dc2e.assert [] == ['item.update']; the new test passes.to_threadreturns), the new test fails withthe committed audit was dropped.test/test_knowledge_handlers_off_loop.py: 82 passed;TestAuditRidesWithTheWrite5 consecutive runs green.scripts/check_black_formatting.pypasses; isort and flake8 on the changed file pass. mypy scope (src/kiro_crew/) is untouched.Manual verification
N/A — deterministic test-only change, verified by the fault-injection runs above.
Related Issues
Fixes #13730
Pattern harvest
Rule candidate: review-prompt
Pattern: A test that proves background work finished must wait on a signal that work sets, not sleep a fixed interval and then assert.
Checklist
.githubchanges in the diff