Repository navigation
Fix race in persist publish queue - #5240
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a race/flakiness in the "persist publish queue" history publishing acceptance test by waiting not only for publish completion, but also for SCP history trimming to have progressed past the expected range.
Changes:
- Replace a publish-success-only busy wait with
testutil::crankUntil(...)plus an additional predicate checking SCP history trimming progress. - Add a small helper query (
SELECT MIN(ledgerseq) FROM scphistory) to verify trimming has caught up before asserting on trimmed history. - Clarify the test comment to explicitly refer to “SCP history”.
marta-lokhova
approved these changes
Apr 21, 2026
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.
Description
Fixes a race in "persist publish queue" tests.
Here is a diff to repro the original failure:
I think this issue is from #5229. We used to purge SCP state in
newSlotExternalized, but now it get's called post apply.while (hm1.getPublishSuccessCount() < 5)was a bad check, since we could increment the published count before hitting the SCP message cleanup. I think the race existed for a while, but the most recent PR delayed cleanup, so it made it more likely to occur. The race seems like it's just in the test itself.Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)