time: more deflaking asynctimer tests

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>
This commit is contained in:
Russ Cox 2024-05-08 10:59:34 -04:00 committed by Gopher Robot
parent 4ed358b57e
commit 46aa30ff48
1 changed files with 2 additions and 3 deletions

View 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()