]> Cypherpunks repositories - gostls13.git/commitdiff
time: more deflaking asynctimer tests
authorRuss Cox <rsc@golang.org>
Wed, 8 May 2024 14:59:34 +0000 (10:59 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 8 May 2024 15:49:05 +0000 (15:49 +0000)
For #66322.

Change-Id: I1d83c7a3cacd2ab012039d954270a7c87bbdf5ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/584195
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>

src/time/tick_test.go

index 42ef6d3217f23e98042ec13ae0e89420f7500649..4aaf6a2b80259171320f5ede039f8f864efe92b1 100644 (file)
@@ -440,7 +440,7 @@ func testTimerChan(t *testing.T, tim timer, C <-chan Time, synctimerchan bool) {
                Sleep(sched)
                tim.Reset(10000 * Second)
                if isTicker {
-                       assertTick()
+                       drain()
                }
                noTick()
 
@@ -466,8 +466,7 @@ func testTimerChan(t *testing.T, tim timer, C <-chan Time, synctimerchan bool) {
        Sleep(sched)
        tim.Reset(10000 * Second)
        if !synctimerchan && isTicker {
-               assertLen()
-               assertTick()
+               drain()
        }
        noTick()