From cd7ce720c779d7bc5b8e43726e2e5ca68756774a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 29 Oct 2019 00:37:15 -0700 Subject: [PATCH] fix test --- weed/storage/needle/needle_read_write_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weed/storage/needle/needle_read_write_test.go b/weed/storage/needle/needle_read_write_test.go index 4c507f9e6..7b05d5d10 100644 --- a/weed/storage/needle/needle_read_write_test.go +++ b/weed/storage/needle/needle_read_write_test.go @@ -5,6 +5,7 @@ import ( "os" "testing" + "github.com/chrislusf/seaweedfs/weed/storage/backend" "github.com/chrislusf/seaweedfs/weed/storage/types" ) @@ -54,7 +55,10 @@ func TestAppend(t *testing.T) { os.Remove(tempFile.Name()) }() - offset, _, _, _ := n.Append(tempFile, CurrentVersion) + datBackend := backend.NewDiskFile(tempFile.Name(), tempFile) + defer datBackend.Close() + + offset, _, _, _ := n.Append(datBackend, CurrentVersion) if offset != uint64(fileSize) { t.Errorf("Fail to Append Needle.") }