mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #846 from bingoohuang/master
use file.Truncate to reset file size to speedup test
This commit is contained in:
commit
01060c9925
|
@ -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…
Reference in a new issue