mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-01 16:21:44 +08:00
use tempFile.Truncate to reset file size to speedup test
This commit is contained in:
parent
3f56b12ed4
commit
cf0fc797ac
@ -1,9 +1,7 @@
|
|||||||
package storage
|
package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
@ -49,7 +47,7 @@ func TestAppend(t *testing.T) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
fileSize := int64(4294967295) + 10000
|
fileSize := int64(4294967295) + 10000
|
||||||
io.CopyN(tempFile, rand.Reader, fileSize)
|
tempFile.Truncate(fileSize)
|
||||||
defer func() {
|
defer func() {
|
||||||
tempFile.Close()
|
tempFile.Close()
|
||||||
os.Remove(tempFile.Name())
|
os.Remove(tempFile.Name())
|
||||||
|
Loading…
Reference in New Issue
Block a user