Browse Source

Merge pull request #846 from bingoohuang/master

use file.Truncate to reset file size to speedup test
pull/2025/head
Chris Lu 6 years ago
committed by GitHub
parent
commit
01060c9925
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      weed/storage/needle_read_write_test.go

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

Loading…
Cancel
Save