go/doc/next/6-stdlib/1-synctest.md

429 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.