testing/synctest: panic with time.NewTimer
#70741
Labels
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Go version
go version devel go1.24-312f7c1bd3 Fri Dec 6 21:15:30 2024 +0000 X:synctest darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I've been kicking the tires on the experimental testing/synctest feature. I have converted a few tests to use it successfully. But I am running into a panic issue: any test case that uses
time.NewTimer
ortime.After
and thentime.Sleep
panics, for exampleWhat did you see happen?
What did you expect to see?
I would expect this test to succeed, pretty much immediately due to synctest stubbing out the Sleep.
If I use
time.NewTicker
instead, then it does succeed, as long as IStop()
that ticker (see this other issue)The text was updated successfully, but these errors were encountered: