Commit b2cf7b5f authored by Alex Brainman's avatar Alex Brainman

misc/cgo/test: fix after latest time changes

R=rsc
CC=golang-dev
https://golang.org/cl/5454047
parent 3dbecd59
...@@ -36,11 +36,11 @@ func BackgroundSleep(n int) { ...@@ -36,11 +36,11 @@ func BackgroundSleep(n int) {
} }
func testParallelSleep(t *testing.T) { func testParallelSleep(t *testing.T) {
dt := -time.Nanoseconds() start := time.Now()
parallelSleep(1) parallelSleep(1)
dt += time.Nanoseconds() dt := time.Now().Sub(start)
// bug used to run sleeps in serial, producing a 2-second delay. // bug used to run sleeps in serial, producing a 2-second delay.
if dt >= 1.3e9 { if dt >= 1300*time.Millisecond {
t.Fatalf("parallel 1-second sleeps slept for %f seconds", float64(dt)/1e9) t.Fatalf("parallel 1-second sleeps slept for %f seconds", dt.Seconds())
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment