diff options
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/synctest/synctest.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/testing/synctest/synctest.go b/src/testing/synctest/synctest.go index c7e93b2201..1664cb8484 100644 --- a/src/testing/synctest/synctest.go +++ b/src/testing/synctest/synctest.go @@ -72,10 +72,17 @@ // - a blocking select statement where every case is a channel created // within the bubble // - [sync.Cond.Wait] -// - [sync.WaitGroup.Wait] +// - [sync.WaitGroup.Wait], when [sync.WaitGroup.Add] was called within the bubble // - [time.Sleep] // -// Locking a [sync.Mutex] or [sync.RWMutex] is not durably blocking. +// Operations not in the above list are not durably blocking. +// In particular, the following operations may block a goroutine, +// but are not durably blocking because the goroutine can be unblocked +// by an event occurring outside its bubble: +// +// - locking a [sync.Mutex] or [sync.RWMutex] +// - blocking on I/O, such as reading from a network socket +// - system calls // // # Isolation // @@ -83,6 +90,10 @@ // is associated with it. Operating on a bubbled channel, timer, or // ticker from outside the bubble panics. // +// A [sync.WaitGroup] becomes associated with a bubble on the first +// call to Add or Go. Once a WaitGroup is associated with a bubble, +// calling Add or Go from outside that bubble panics. +// // Cleanup functions and finalizers registered with // [runtime.AddCleanup] and [runtime.SetFinalizer] // run outside of any bubble. |
