Skip to content

Commit

Permalink
fix more windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Aug 13, 2024
1 parent 738001b commit 1b5bb03
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ipld/unixfs/importer/trickle/trickle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
mrand "math/rand"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -678,14 +679,17 @@ func TestAppendWithModTime(t *testing.T) {
const nbytes = 128 * 1024

timestamp := time.Now()
ds := mdtest.Mock()
buf := random.Bytes(nbytes)

nd := new(merkledag.ProtoNode)
nd.SetData(ft.FilePBDataWithStat(buf[:nbytes/2], nbytes/2, 0, timestamp))

if runtime.GOOS == "windows" {
time.Sleep(3 * time.Second) // for os with low-res mod time.
}

dbp := &h.DagBuilderParams{
Dagserv: ds,
Dagserv: mdtest.Mock(),
Maxlinks: h.DefaultLinksPerBlock,
}

Expand All @@ -710,12 +714,15 @@ func TestAppendWithModTime(t *testing.T) {

func TestAppendToEmptyWithModTime(t *testing.T) {
timestamp := time.Now()
ds := mdtest.Mock()
nd := new(merkledag.ProtoNode)
nd.SetData(ft.FilePBDataWithStat(nil, 0, 0, timestamp))

if runtime.GOOS == "windows" {
time.Sleep(3 * time.Second) // for os with low-res mod time.
}

dbp := &h.DagBuilderParams{
Dagserv: ds,
Dagserv: mdtest.Mock(),
Maxlinks: h.DefaultLinksPerBlock,
}

Expand Down

0 comments on commit 1b5bb03

Please sign in to comment.