use tempFile.Truncate to reset file size to speedup test

This commit is contained in:
bingoohuang 2019-01-23 16:24:51 +08:00
parent 3f56b12ed4
commit cf0fc797ac

View file

@ -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())