test: make tests deterministic with -scheduler=threads

This commit is contained in:
Ayke van Laethem
2024-11-04 10:16:35 +01:00
committed by Ron Evans
parent 6faf36fc64
commit 31f7214156
5 changed files with 31 additions and 12 deletions
+6 -2
View File
@@ -2,9 +2,11 @@ package main
import (
"runtime"
"time"
"sync"
)
var wg sync.WaitGroup
func main() {
println("# simple recover")
recoverSimple()
@@ -113,14 +115,16 @@ func deferPanic() {
}
func runtimeGoexit() {
wg.Add(1)
go func() {
defer func() {
println("Goexit deferred function, recover is nil:", recover() == nil)
wg.Done()
}()
runtime.Goexit()
}()
time.Sleep(time.Millisecond)
wg.Wait()
}
func printitf(msg string, itf interface{}) {