Repository navigation
Keep index building out of the retention window in the audit retention tests - #5874
Merged
Merged
Conversation
…ion tests The two second retention window started at ingestion, while the fresh database's indexes were still being built, and on a busy runner that alone took longer than the window, so the query that should see the document before it expires found nothing. The indexes are now built before ingestion, and the fixed four second sleep is replaced by polling, so the test takes as long as expiration actually needs.
|
|
||
| // Polls instead of sleeping for a fixed time, so the test takes as long as expiration actually | ||
| // needs and still tolerates a slow expiration pass. | ||
| static async Task<T> WaitUntil<T>(Func<CancellationToken, Task<T>> query, Func<T, bool> condition) |
Contributor
There was a problem hiding this comment.
So we have no existing helper that already does that?
mauroservienti
approved these changes
Sep 10, 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.
AuditMessageRetentionandSagaSnapshotRetentionfailed four times in the last 60 CI runs, always on the query that should still see the document. The two second retention window starts at ingestion, and on a busy Windows runner building the fresh database's indexes ate the whole window before the query ran.The tests now wait for the indexes before ingesting, use a three second window with a one second expiration pass, and poll for expiry instead of sleeping a fixed four seconds. Passes three runs in a row locally at 7 s and 4 s.