From cf0fc797ac3d28cbd93b309c53c32780e08f2e22 Mon Sep 17 00:00:00 2001 From: bingoohuang Date: Wed, 23 Jan 2019 16:24:51 +0800 Subject: [PATCH] use tempFile.Truncate to reset file size to speedup test --- weed/storage/needle_read_write_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/weed/storage/needle_read_write_test.go b/weed/storage/needle_read_write_test.go index 8bd9205c1..2532e6a38 100644 --- a/weed/storage/needle_read_write_test.go +++ b/weed/storage/needle_read_write_test.go @@ -1,9 +1,7 @@ package storage import ( - "crypto/rand" "github.com/chrislusf/seaweedfs/weed/storage/types" - "io" "io/ioutil" "os" "testing" @@ -49,7 +47,7 @@ func TestAppend(t *testing.T) { */ fileSize := int64(4294967295) + 10000 - io.CopyN(tempFile, rand.Reader, fileSize) + tempFile.Truncate(fileSize) defer func() { tempFile.Close() os.Remove(tempFile.Name())