tests: adopt synctest in some places - #16321
Merged
Merged
Conversation
npazosmendez
force-pushed
the
njpm/speed-up-tests-synctest
branch
from
August 6, 2026 20:07
fead9a4 to
47e11dd
Compare
npazosmendez
marked this pull request as ready for review
August 6, 2026 20:17
Contributor
|
please rebase this PR on latest main, otherwise it can't merge — it's blocked on required checks that will never report. context: #16335 changed the unit test CI matrix and the required checks got renamed ( |
narqo
approved these changes
Aug 11, 2026
narqo
left a comment
Contributor
There was a problem hiding this comment.
Structurally, the changes make sense 🔥
I think, in the future we can improve individual tests, which may not even need time.Sleep under the synctest. Thank you for working on that
Wrap wait-heavy tests in synctest.Test so their sleeps, tickers and retry backoffs run on fake time. Test-only change, no logic changes.
npazosmendez
force-pushed
the
njpm/speed-up-tests-synctest
branch
from
August 11, 2026 11:52
47e11dd to
d95619f
Compare
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.
What this PR does
A bunch of tests that play with sleeps, tickers, etc. can be sped up greatly by simply wrapping them with
synctest.Test. There are still a bunch of other tests that would benefit from this, but I tried to scope it down to the ones that just needed to be wrapped, to start with.Review with "Hide whitespace" for saneness
Speed up breakdown
Ran locally. This will not have the same impact on CI, mostly because tests are parallelized.mainTestMultiDimensionalQueueAlgorithmSlowConsumerEffectsTestRemoteQuerier_QueryRetryOnFailureTestRecordAndReportRuleQueryMetricsTestStoreGateway_InitialSyncFailureTestRulerSyncQueue_ShouldNotNotifyChannelMoreFrequentlyThanPollFrequencyTestRemoteQuerier_StatusErrorResponsesTestLifecycler_CheckReadyTestReaderPool_ShouldCloseIdleLazyReadersTestRuler_NotifySyncRulesAsync_ShouldNotTriggerRulesSyncingOnAllRulersWhenDisabledTestHATrackerCheckReplicaShouldFixZeroElectedAtTimestampTestIngesterRestartTestAwaitQueryFrontendServiceRunning_ServiceIsNotReadyInitiallyWhich issue(s) this PR fixes or relates to
n/a
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]. If changelog entry is not needed, please add thechangelog-not-neededlabel to the PR.about-versioning.mdupdated with experimental features.