The Go Blog Follow Testing concurrent code with testing/synctest Go 1.24 contains an experimental package to aid in testing concurrent code. https://go.dev/blog/synctest go.dev