実験コードを交えての解説 a. GoDoc を読む b. Run / Test がそれぞれどのような役割があるのか 4. Go クイズ! 5. 弊社での実際の活⽤例 6. Go 1.24からの変更点 7. 今後の展望 8. API の内部実装(時間があれば) testing/synctest を完全理解する!
される場合に “durably block” になる 2. 以下の操作はゴルーチンを “durably block” する a. time.Sleep b. etc... 3. 以下の操作はゴルーチンを “durably block” しない a. sync.Mutex or sync.RWMutex b. etc...
durably blocked: - Wait returns, if it has been called. - Otherwise, time advances to the next time that will unblock at least one goroutine, if there is such a time and the root goroutine of the bubble has not exited. - Otherwise, there is a deadlock and Test panics.
turned out to be very confusing when a long-lived goroutine never returned, such as a goroutine reading forever from a time.Ticker. We now stop advancing time when a bubble’s root goroutine returns. If the bubble is blocked waiting for time to advance, this results in a deadlock and a panic which can be analyzed.
bug fixes, we don’t currently expect any major changes to it in the future. Of course, with wider adoption it is always possible that we’ll discover something that needs doing. 避けられないバグ修正を除けば、現時点では将来的に大きな変更は予定し ていません。もちろん、適用範囲が広がれば、対応が必要な問題が見つか る可能性は常にあります。 ⼤きな変更はないと考えて良さそう 💡
testing concurrent code 4. testing/synctest: replace Run with Test 5. proposal: testing/synctest: create bubbles with Start rather than Run 6. Testing Time (and other asynchronous code) - Damien Neil | GopherCon EU 2025