]> Cypherpunks repositories - gostls13.git/commit
runtime, testing/synctest: stop advancing time when main goroutine exits
authorDamien Neil <dneil@google.com>
Tue, 1 Apr 2025 22:43:22 +0000 (15:43 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 7 May 2025 20:14:25 +0000 (13:14 -0700)
commitd6c8bedc7b3d2de7714dca75bd05912b371538f1
tree352d43791d26d75bed756a7b02ef69b872483872
parent4e63ae46e097062b72424b2ac1da6e7dac33064b
runtime, testing/synctest: stop advancing time when main goroutine exits

Once the goroutine started by synctest.Run exits, stop advancing
the fake clock in its bubble. This avoids confusing situations
where a bubble remains alive indefinitely while a background
goroutine reads from a time.Ticker or otherwise advances the clock.

For #67434

Change-Id: Id608ffe3c7d7b07747b56a21f365787fb9a057d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/662155
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
src/internal/synctest/synctest_test.go
src/runtime/synctest.go
src/testing/synctest/synctest.go