test: deflake test_rendered_helper_spawns_when_health_fails#54
Merged
Conversation
The production bash spawns ``nohup ... & disown`` — fire-and-forget, correct behavior. The test's fake ``nohup`` writes a marker file so the assertion can verify the spawn cmdline was constructed correctly. But the parent script returns rc=1 from the polling loop in milliseconds (sleep is a no-op shim) while the backgrounded fake nohup races to write the marker. On Python 3.10 GitHub runners the parent regularly wins the race and the test sees a missing marker even though the production code is correct (run 25593801334 today). Fix: poll for the marker for up to 3s before asserting. Production behavior unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
The test races a backgrounded `nohup` against the parent script's exit. Production code uses `nohup ... & disown` (correct fire-and-forget); the test's fake `nohup` writes a marker to verify cmdline construction. With sleep shimmed to a no-op, the parent script returns rc=1 in milliseconds while the backgrounded fake nohup may not have run yet — the marker assert sees an empty path.
This bit main CI today as run 25593801334, passing on Python 3.11 / 3.12 / postgres / TS but failing on 3.10. Local: 5/5 passes; rerun on the same commit: success. Pure timing flake, no regression in production code.
Fix: after the bash run, poll for the marker for up to 3s before asserting. Production behavior unchanged.
Test plan
🤖 Generated with Claude Code