From 9ef34d12e83f327a9f8d6f53cfd18330aa798ebb Mon Sep 17 00:00:00 2001 From: Serhiy Bzhezytskyy Date: Sun, 16 Aug 2026 19:26:58 +0300 Subject: [PATCH] testing/synctest: document channel and timer violations as fatal The difference between a panic and a fatal panic is observable: recover cannot contain a fatal panic. A test that creates a channel inside a bubble and sends on it after the bubble has returned aborts the process, and a deferred recover never runs. CL 696195 changed bubble violations for channel and timer operations from regular panics to fatal panics, so that all bubble violations are consistently fatal. The package doc comment still says that operating on a bubbled channel, timer or ticker from outside the bubble panics. The neighboring sentences in the same section were updated to say "is a fatal error" in CL 675617, for WaitGroup.Add/Go and for Cond.Wait. This makes the channel, timer and ticker sentence agree with them. Updates #74837 --- src/testing/synctest/synctest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testing/synctest/synctest.go b/src/testing/synctest/synctest.go index 60c3d033bb4ef7..5b6b9b2d0b4b46 100644 --- a/src/testing/synctest/synctest.go +++ b/src/testing/synctest/synctest.go @@ -96,7 +96,7 @@ // // A channel, [time.Timer], or [time.Ticker] created within a bubble // is associated with it. Operating on a bubbled channel, timer, or -// ticker from outside the bubble panics. +// ticker from outside the bubble is a fatal error. // // A [sync.WaitGroup] becomes associated with a bubble on the first // call to Add or Go. Once a WaitGroup is associated with a bubble,