0
1
mirror of https://github.com/golang/go synced 2025-05-22 05:48:03 +00:00
Files
go/doc/next/6-stdlib/1-synctest.md
Damien Neil 49a660e22c testing/synctest: add Test
Add a synctest.Test function, superseding the experimental
synctest.Run function. Promote the testing/synctest package
out of experimental status.

For #67434
For #73567

Change-Id: I3c5ba030860d90fe2ddb517a2f3536efd60181a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/671961
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2025-05-20 15:46:03 -07:00

381 B

New testing/synctest package

The new testing/synctest package provides support for testing concurrent code.

The [synctest.Test] function runs a test function in an isolated "bubble". Within the bubble, time package functions operate on a fake clock.

The [synctest.Wait] function waits for all goroutines in the current bubble to block.