use synctest to make receive stream tests fully deterministc (#5291)

This commit is contained in:
Marten Seemann
2025-08-20 15:44:19 +08:00
committed by GitHub
parent fb82d0da00
commit 257281b6e2
5 changed files with 271 additions and 222 deletions

View File

@@ -0,0 +1,14 @@
//go:build go1.24 && !go1.25
package synctest
import (
"testing"
"testing/synctest"
)
func Test(t *testing.T, f func(t *testing.T)) {
synctest.Run(func() {
f(t)
})
}

View File

@@ -0,0 +1,12 @@
//go:build go1.25
package synctest
import (
"testing"
"testing/synctest"
)
func Test(t *testing.T, f func(t *testing.T)) {
synctest.Test(t, f)
}