test: fix two flaky tests that fail intermittently in CI#3844
Merged
Conversation
- test_remove_start_end_nodes asserted positional order on an unordered queryset (Node has no Meta.ordering); compare flow_id sets instead. - test_prune_stale_clients raced real wall-clock sleeps against the stale timeout; backdate the first client's timestamp instead of sleeping. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
📝 WalkthroughWalkthroughTwo tests were revised for deterministic behavior. The pipeline test now compares the remaining node Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SmittieC
marked this pull request as ready for review
July 17, 2026 12:56
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.
Product Description
No change — test-only fixes.
Technical Description
Two tests fail intermittently in CI:
test_remove_start_end_nodesasserted onpipeline.node_set.all()[0]/[1], butNodehas noMeta.ordering, so Postgres returns rows in arbitrary heap order afterremove_all_start_end_nodesdeletes and rewrites rows. Replaced the positional asserts with a set comparison offlow_ids, which is what the test actually meant to check.test_prune_stale_clientsslept real wall-clock time (0.4s + 0.1s) against a 0.5s stale timeout, so on a slow runner both clients went stale and got pruned (assert 0 == 1). The sleeps are gone; the test now backdates the first client's timestamp past the timeout, making it deterministic.Docs and Changelog
🤖 Generated with Claude Code