diff options
| author | Aleksey Kosov <rusyak777@list.ru> | 2025-05-28 21:34:02 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-28 11:34:02 -0700 |
| commit | 283d9e0079d5deb57aefe9a7b30e8b9869ba8685 (patch) | |
| tree | 87b09bebed2ee4afc9c2a4f711ac8598fe2949b7 /weed/filer/filechunks_test.go | |
| parent | 62aaaa18f3ea8b7600d28934580dc220ca95164a (diff) | |
| download | seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.tar.xz seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.zip | |
Add context with request (#6824)
Diffstat (limited to 'weed/filer/filechunks_test.go')
| -rw-r--r-- | weed/filer/filechunks_test.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/weed/filer/filechunks_test.go b/weed/filer/filechunks_test.go index 7554b0080..4af2af3f6 100644 --- a/weed/filer/filechunks_test.go +++ b/weed/filer/filechunks_test.go @@ -1,6 +1,7 @@ package filer import ( + "context" "fmt" "log" "math" @@ -21,7 +22,7 @@ func TestCompactFileChunks(t *testing.T) { {Offset: 110, Size: 200, FileId: "jkl", ModifiedTsNs: 300}, } - compacted, garbage := CompactFileChunks(nil, chunks) + compacted, garbage := CompactFileChunks(context.Background(), nil, chunks) if len(compacted) != 3 { t.Fatalf("unexpected compacted: %d", len(compacted)) @@ -54,7 +55,7 @@ func TestCompactFileChunks2(t *testing.T) { }) } - compacted, garbage := CompactFileChunks(nil, chunks) + compacted, garbage := CompactFileChunks(context.Background(), nil, chunks) if len(compacted) != 4 { t.Fatalf("unexpected compacted: %d", len(compacted)) @@ -90,7 +91,7 @@ func TestRandomFileChunksCompact(t *testing.T) { } } - visibles, _ := NonOverlappingVisibleIntervals(nil, chunks, 0, math.MaxInt64) + visibles, _ := NonOverlappingVisibleIntervals(context.Background(), nil, chunks, 0, math.MaxInt64) for visible := visibles.Front(); visible != nil; visible = visible.Next { v := visible.Value @@ -228,7 +229,7 @@ func TestIntervalMerging(t *testing.T) { for i, testcase := range testcases { log.Printf("++++++++++ merged test case %d ++++++++++++++++++++", i) - intervals, _ := NonOverlappingVisibleIntervals(nil, testcase.Chunks, 0, math.MaxInt64) + intervals, _ := NonOverlappingVisibleIntervals(context.Background(), nil, testcase.Chunks, 0, math.MaxInt64) x := -1 for visible := intervals.Front(); visible != nil; visible = visible.Next { x++ @@ -426,7 +427,7 @@ func TestChunksReading(t *testing.T) { // continue } log.Printf("++++++++++ read test case %d ++++++++++++++++++++", i) - chunks := ViewFromChunks(nil, testcase.Chunks, testcase.Offset, testcase.Size) + chunks := ViewFromChunks(context.Background(), nil, testcase.Chunks, testcase.Offset, testcase.Size) x := -1 for c := chunks.Front(); c != nil; c = c.Next { x++ @@ -473,7 +474,7 @@ func BenchmarkCompactFileChunks(b *testing.B) { } for n := 0; n < b.N; n++ { - CompactFileChunks(nil, chunks) + CompactFileChunks(context.Background(), nil, chunks) } } @@ -562,7 +563,7 @@ func TestCompactFileChunks3(t *testing.T) { {Offset: 300, Size: 100, FileId: "def", ModifiedTsNs: 200}, } - compacted, _ := CompactFileChunks(nil, chunks) + compacted, _ := CompactFileChunks(context.Background(), nil, chunks) if len(compacted) != 4 { t.Fatalf("unexpected compacted: %d", len(compacted)) |
