Skip to content

Commit

Permalink
lock fix for flaky test (#2268)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d authored Jun 26, 2020
1 parent 8161b92 commit 48b8504
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/querier/queryrange/querysharding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"sort"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -125,9 +126,12 @@ func Test_shardSplitter(t *testing.T) {
}

func Test_astMapper(t *testing.T) {
var lock sync.Mutex
called := 0

handler := queryrange.HandlerFunc(func(ctx context.Context, req queryrange.Request) (queryrange.Response, error) {
lock.Lock()
defer lock.Unlock()
resp := lokiResps[called]
called++
return resp, nil
Expand Down

0 comments on commit 48b8504

Please sign in to comment.