wal: remove the repeated test case

The TestFilePipelineFailLockFile case maybe test the line 77 in the alloc function. But the LockFile will not throw an error when the file lock is hold. And TestFilePipelineFailPreallocate and TestFilePipelineFailLockFile are exactly the same except for the comments.

Signed-off-by: SimFG <1142838399@qq.com>
This commit is contained in:
SimFG 2022-06-13 11:30:49 +08:00
parent 4b41f74ff8
commit 402188a98c
2 changed files with 1 additions and 12 deletions

View File

@ -58,6 +58,7 @@ func newFilePipeline(lg *zap.Logger, dir string, fileSize int64) *filePipeline {
// Open returns a fresh file for writing. Rename the file before calling
// Open again or there will be file collisions.
// it will 'block' if the tmp file lock is already taken.
func (fp *filePipeline) Open() (f *fileutil.LockedFile, err error) {
select {
case f = <-fp.filec:

View File

@ -45,15 +45,3 @@ func TestFilePipelineFailPreallocate(t *testing.T) {
t.Fatal("expected error on invalid pre-allocate size, but no error")
}
}
func TestFilePipelineFailLockFile(t *testing.T) {
tdir := t.TempDir()
fp := newFilePipeline(zaptest.NewLogger(t), tdir, math.MaxInt64)
defer fp.Close()
f, ferr := fp.Open()
if f != nil || ferr == nil { // no such file or directory
t.Fatal("expected error on invalid pre-allocate size, but no error")
}
}