Skip to content

Commit

Permalink
Use concurrent open/close operations in compactor unit tests (#1844)
Browse files Browse the repository at this point in the history
Open and close files concurrently in compactor unit tests to expose bugs
that implicitly rely on ordering.

Exposes bugs such as prometheus/prometheus#10108

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
  • Loading branch information
56quarters committed May 13, 2022
1 parent 915eecd commit be7a465
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/compactor/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,11 @@ func prepareConfig(t *testing.T) Config {
compactorCfg.retryMinBackoff = 0
compactorCfg.retryMaxBackoff = 0

// Use settings that ensure things will be done concurrently, verifying ordering assumptions.
// Helps to expose bugs such as https://github.com/prometheus/prometheus/pull/10108
compactorCfg.MaxOpeningBlocksConcurrency = 3
compactorCfg.MaxClosingBlocksConcurrency = 3

// Do not wait for ring stability by default, in order to speed up tests.
compactorCfg.ShardingRing.WaitStabilityMinDuration = 0
compactorCfg.ShardingRing.WaitStabilityMaxDuration = 0
Expand Down

0 comments on commit be7a465

Please sign in to comment.