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

Commit

Permalink
Call Checkpoint in TestReadCheckpointMultipleSegments instead of
Browse files Browse the repository at this point in the history
manually creating a checkpoint dir and renaming files.

Signed-off-by: Callum Styan <[email protected]>
  • Loading branch information
cstyan committed Jun 5, 2019
1 parent 1caa80c commit 62729b5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions wal/wal_watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,9 @@ func TestReadCheckpointMultipleSegments(t *testing.T) {
}
}

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

wt := newWriteToMock()
watcher := NewWALWatcher(nil, nil, "", wt, dir)
Expand Down

0 comments on commit 62729b5

Please sign in to comment.