mirror of
https://github.com/prometheus/prometheus
synced 2024-12-29 02:02:17 +00:00
Merge pull request #12875 from dimitarvdimitrov/dimitar/TestQuerierIndexQueriesRace-incorrect-exit-condition
Fix samples generation in TestQuerierIndexQueriesRace The loop would run forever if the context was cancelled before the goroutine got started.
This commit is contained in:
commit
d498bb0d8c
@ -2252,7 +2252,7 @@ func TestQuerierIndexQueriesRace(t *testing.T) {
|
||||
func appendSeries(t *testing.T, ctx context.Context, wg *sync.WaitGroup, h *Head) {
|
||||
defer wg.Done()
|
||||
|
||||
for i := 0; ctx.Err() != nil; i++ {
|
||||
for i := 0; ctx.Err() == nil; i++ {
|
||||
app := h.Appender(context.Background())
|
||||
_, err := app.Append(0, labels.FromStrings(labels.MetricName, "metric", "seq", strconv.Itoa(i), "always_0", "0"), 0, 0)
|
||||
require.NoError(t, err)
|
||||
|
Loading…
Reference in New Issue
Block a user