Fix flaky PublicationManager relation tracker restart test#4635
Open
erik-the-implementer wants to merge 2 commits into
Open
Fix flaky PublicationManager relation tracker restart test#4635erik-the-implementer wants to merge 2 commits into
erik-the-implementer wants to merge 2 commits into
Conversation
Fixes #4606. The "handles relation tracker restart" test stopped the RelationTracker and relied on assert_pub_tables as a "wait for restart" barrier. It isn't one: the relation is already in the publication and isn't removed during the restart, so the assertion passes immediately - potentially before the supervisor has restarted and re-registered the process. The subsequent remove_shape call then raced with a "no process" exit. Wait for the RelationTracker to be re-registered and to finish restoring its filters before issuing further calls. Reuse the existing wait-on-condition idiom rather than adding a bespoke helper: promote the generic poller to Support.TestUtils as wait_until/2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4635 +/- ##
=======================================
Coverage 59.46% 59.46%
=======================================
Files 385 385
Lines 43039 43039
Branches 12383 12383
=======================================
Hits 25591 25591
- Misses 17371 17373 +2
+ Partials 77 75 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #4606.
Problem
The
PublicationManagerTest"handles relation tracker restart" test is flaky. It stops theRelationTracker(the supervisor then restarts it) and relies onassert_pub_tablesas a "wait for restart" barrier — but it isn't one.The relation is already in the publication and is not removed during the restart, so
assert_pub_tables(ctx, [ctx.relation], …)passes immediately, potentially before the supervisor has restarted and re-registered the process. The subsequentPublicationManager.remove_shape/2call (→GenServer.call(name(stack_id), …)) then races with a "no process" exit.Fix
Wait for the
RelationTrackerto be re-registered, then for it to finish restoring its filters fromShapeStatus, before issuing further calls:Rather than add a bespoke helper, this promotes the existing private
wait_untilpoller (previously inshape_cache_test.exs) into the sharedSupport.TestUtilsaswait_until/2, and migrates its original call site to the shared version.Verification
15/15 seeded runs of the target test pass; the full
publication_manager_test.exs(26 tests) and the migratedshape_cache_test.exstest are green. Test-only change, so no changeset.🤖 Generated with Claude Code