aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2019-01-23 11:27:50 -0800
committerGitHub <noreply@github.com>2019-01-23 11:27:50 -0800
commit01060c992591f412b0d5e180bde29991747a9462 (patch)
tree3c8378801d33a8b18d5077fb40bec977310f015f
parent3f56b12ed40c1cebaa669003942d14af826ff42c (diff)
parentcf0fc797ac3d28cbd93b309c53c32780e08f2e22 (diff)
downloadseaweedfs-01060c992591f412b0d5e180bde29991747a9462.tar.xz
seaweedfs-01060c992591f412b0d5e180bde29991747a9462.zip
Merge pull request #846 from bingoohuang/master
use file.Truncate to reset file size to speedup test
-rw-r--r--weed/storage/needle_read_write_test.go4
1 files changed, 1 insertions, 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())