Skip to content

Commit 529e8ac

Browse files
committed
fix ut
Signed-off-by: jiefenghuang <[email protected]>
1 parent d6cbb91 commit 529e8ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/chunk/prefetch_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package chunk
22

33
import (
4+
"context"
45
"sync/atomic"
56
"testing"
67
"time"
@@ -15,7 +16,7 @@ func TestPrefetcher(t *testing.T) {
1516
chRes <- k + "Done"
1617
})
1718
for _, k := range keys {
18-
f.fetch(k)
19+
f.fetch(context.TODO(), k)
1920
}
2021
res := make(map[string]bool, len(keys))
2122
for range keys {
@@ -39,7 +40,7 @@ func TestPrefetcher(t *testing.T) {
3940
atomic.AddInt32(&counter, 1)
4041
})
4142
for i := 0; i < 5; i++ {
42-
f.fetch("a")
43+
f.fetch(context.TODO(), "a")
4344
}
4445
if atomic.LoadInt32(&counter) > 1 {
4546
t.Errorf("Duplicate keys fetched")
@@ -56,7 +57,7 @@ func TestPrefetcher(t *testing.T) {
5657
})
5758

5859
for i := 0; i < maxPending+1; i++ {
59-
f.fetch(string(rune('a' + i)))
60+
f.fetch(context.TODO(), string(rune('a'+i)))
6061
}
6162

6263
time.Sleep(50 * time.Millisecond)

0 commit comments

Comments
 (0)