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

Commit 62729b5

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 1caa80c commit 62729b5

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
@@ -409,14 +409,9 @@ func TestReadCheckpointMultipleSegments(t *testing.T) {
409409
}
410410
}
411411

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

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

0 commit comments

Comments
 (0)