Fix flaky test_hybrid_properties controlled-input race#6682
Conversation
test_hybrid_properties cleared the `set_info_a` input (Ctrl+A, Delete) and
immediately typed "z" before the clear had round-tripped to the backend. Since
the input is controlled by State.info.a, the rapid sequence raced the async
state sync, intermittently producing "info_a_b: az - b" (typed onto a stale
"a") or "info_a_b: - b" (the "z" dropped by a late empty-state delta) instead
of "info_a_b: z - b".
Serialize the interaction: after clearing, poll the backend-derived text until
it reflects the empty value ("info_a_b: - b") before typing "z", then poll for
the final "info_a_b: z - b". This mirrors the poll-between-interactions pattern
already used in test_event_chain.py and removes the race without changing the
app under test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ELfV78gRoQiknTTEXctPs
Greptile SummaryFixes a flaky integration test caused by a timing race on a controlled input. The fix adds an intermediate
Confidence Score: 5/5Safe to merge. The change is a single-file test-only fix with no impact on production code. The change is entirely confined to a test file: it inserts a well-understood polling step between two Selenium interactions on a controlled input, following the same serialization pattern already used in test_event_chain.py. The intermediate assertion ("info_a_b: - b") is exactly what was observed in the failing CI runs, and the second poll's sentinel is correctly updated to match. No production code is touched. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Fix flaky test_hybrid_properties control..." | Re-trigger Greptile |
Merging this PR will not alter performance
Comparing Footnotes
|
tests/integration/test_hybrid_properties.py::test_hybrid_propertiesis flaky on theintegration-app-harnessshards (seen on #6680/#6681 and reproducible across runs).Root cause
The test clears the
set_info_ainput (Ctrl+A,Delete) and immediately types"z":set_info_ais a controlled input (value=State.info.a,on_change=State.update_info_a), so each keystroke round-trips through the backend. Firing the clear and the type back-to-back races that async sync, intermittently producing:info_a_b: az - b— the"z"is typed onto a stale"a"(clear hadn't re-rendered yet)info_a_b: - b— the"z"is dropped by a late empty-state delta…instead of the expected
info_a_b: z - b. The non-deterministic values (two different wrong answers) confirm it's a timing race, not a logic bug.pytest-rerunfailuresalready retries 3× and still flakes.Fix
Serialize the interaction — wait for the cleared value to round-trip to the backend (poll the backend-derived
info_a_btext for"info_a_b: - b") before typing"z", then poll for the final"info_a_b: z - b". This mirrors the poll-between-interactions pattern already used intest_event_chain.pyand removes the race without changing the app under test. The intermediate value ("info_a_b: - b") is exactly what Selenium returned in the observed failure.Validation
ruff(format + check),pyright, and pytest collection pass locally. Behavioral validation is theintegration-app-harnessshards in CI — this PR exercises them directly.🤖 Generated with Claude Code
https://claude.ai/code/session_017ELfV78gRoQiknTTEXctPs
Generated by Claude Code