]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix timeout slack calculation
authorShenghou Ma <minux.ma@gmail.com>
Sun, 4 Nov 2012 10:07:59 +0000 (18:07 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sun, 4 Nov 2012 10:07:59 +0000 (18:07 +0800)
R=alex.brainman
CC=golang-dev
https://golang.org/cl/6816085

src/pkg/net/timeout_test.go

index d81cbb7c85d8b74f525594bf70a75e0349dc395f..68d8ced011a2b66dd131352072a1ad288a6f606e 100644 (file)
@@ -164,7 +164,7 @@ func TestReadWriteDeadline(t *testing.T) {
        )
        checkTimeout := func(command string, start time.Time, should time.Duration) {
                is := time.Now().Sub(start)
-               d := should - is
+               d := is - should
                if d < -30*time.Millisecond || !testing.Short() && 150*time.Millisecond < d {
                        t.Errorf("%s timeout test failed: is=%v should=%v\n", command, is, should)
                }