Repository navigation
test(platform-log): give the short-writer serialize test a wide budget - #24150
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change is test-only and widens one monkeypatched budget that [DESIGN-REVIEWED] 78b18e5 Description read[DESCRIPTION-READ] d12cee7c69216841f68b0480ff1b661657ea05024a48f34f5357c3d51695e4f6 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 |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
test_concurrent_short_writers_serialize timed out on Backend Tests (Windows) with "decision log append deadline expired" and passed on re-run. Four writers are forced into 3-byte writes, so the last one to get the lock waits out the other three's ~37 writes each and then makes its own, all inside one 0.5s _APPEND_TIMEOUT_SECONDS budget: about 3.4ms per write, which a loaded Windows runner can exceed. The test checks serialization, and the deadline has its own test, so raise the budget in this test only, to a named lost-run ceiling of 10s sized from the measured Windows CI durations. A stuck lock still fails it.
837520e to
78b18e5
Compare
|
Addressed the GPT 6.1 D8 finding in 78b18e5. The bare |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only change that raises the append budget for one serialization test so a loaded runner does not fail it on the deadline.
Problem / Motivation
Goal: Stop
test_concurrent_short_writers_serializefailing on slow Windows runners with a deadline error that has nothing to do with what it tests.test/test_platform_log_append.py::test_concurrent_short_writers_serializefailed on Backend Tests (Windows) (3) withTimeoutError: decision log append deadline expired, raised from the write loop inappend_line(src/kiro_crew/platform_log_append.py:350), and passed on re-run (run 40100625828, PR #23697).Why it matters
A red Windows shard on an unrelated PR costs a re-run and a look at the log. It also points the reader at the decision-log deadline, which is working as designed.
Not a goal
_APPEND_TIMEOUT_SECONDSor anything else inplatform_log_append.py. The 0.5 s budget is deliberate: it keeps an observation from occupying a caller on contention.platform_lock_compat.py.What changed (motivation → approach → change)
os.writedown to 3 bytes, so each 111-byte row takes ~37 writes.append_linegives each append one 0.5 s budget, started after the open, that covers the lock wait and every write. The last writer to get the lock waits out the other three's ~37 writes each and then makes its own: about 148 serialized writes plus lock hand-offs, so ~3.4 ms per write. A loaded Windows runner, which also takes the lock by pollingmsvcrt.locking, can be slower than that. The test checks serialization. The deadline is covered bytest_contended_append_times_out_without_writing._APPEND_TIMEOUT_SECONDStoSERIALIZE_APPEND_CEILING_SECS = 10.0, a named lost-run ceiling (testing-conventions D8). The comment beside it cites the measurement: the test's call phase takes at most 0.078 s (median 0.034 s) over 35 ci.yml runs of Windows shard 3 (windows-pytest-progress-3), and 0.72 s per run on Linux with 4 ms added to every write. 10 s is over 10x both and under half the suite's--timeout=120.test_decisions_points.py,test_decisions_tool_risk.pyand the decisions end-to-end tests already raise this budget the same way. The bound is raised, not removed: a stuck lock still fails the test by name, withTimeoutErrorfromappend_line, well insidewait_until's own timeout. No retry, skip or sleep is added.Backwards compatibility
Compatible: test-only change, no production code touched.
Removes nothing: the diff only raises a monkeypatched constant in one test.
Tests
Proof: not provable -- test-only change
Red/green reproduction (Linux, in-process harness that runs the test body N times; per-write latency is added under the test's 3-byte shim, and "flat poll" sets the POSIX lock back-off to Windows' flat
_LOCK_POLL_SECSpoll):taskset -c 0)TimeoutError: decision log append deadline expired(fromplatform_log_append.py:350)taskset -c 0taskset -c 0The red runs fail in the same frame as CI (
_remaining(deadline)in the write loop). At 4 to 5 ms some runs fail earlier, atfile_lock, withcould not acquire exclusive file lock: still held after waiting 0.50s, which is the same budget running out during the lock wait. CPU contention alone did not reproduce it on Linux, where a write is far under 1 ms. The failure needs per-write latency near 0.5 s / 148, which fits a slow Windows runner.Local gate:
python3 scripts/local-gate.pypassed (backend related 179 passed / 7 skipped; frontend related 403 files, 11,983 tests passed). black, isort, flake8, comment-history, brand, file-line-cap and the flake-pattern ratchet (compared with badd8f5aa849) all pass. mypy was not run: nosrc/change.Manual verification
N/A: test-only change. The reproduction above is the verification.
Related Issues
Closes #24149
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.