Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Commit 2f88210

Browse files
committed
Call Checkpoint in TestReadCheckpointMultipleSegments instead of
manually creating a checkpoint dir and renaming files. Signed-off-by: Callum Styan <[email protected]>
1 parent 972da3d commit 2f88210

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

wal/wal_watcher_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,14 +410,9 @@ func TestReadCheckpointMultipleSegments(t *testing.T) {
410410
}
411411
}
412412

413-
// At this point we should have at least 6 segments, lets create a checkpoint dir of the first 5.
414-
checkpointDir := dir + "/wal/checkpoint.000004"
415-
err = os.Mkdir(checkpointDir, 0777)
416-
testutil.Ok(t, err)
417-
for i := 0; i <= 4; i++ {
418-
err := os.Rename(SegmentName(dir+"/wal", i), SegmentName(checkpointDir, i))
419-
testutil.Ok(t, err)
420-
}
413+
Checkpoint(w, 0, 4, func(id uint64) bool {
414+
return true
415+
}, 0)
421416

422417
wt := newWriteToMock()
423418
watcher := NewWALWatcher(nil, nil, "", wt, dir)

0 commit comments

Comments
 (0)