Description
The new synctest
package makes time deterministic within a testing bubble. One consequence of this is that the goroutine schedule also becomes more deterministic within the bubble. But it's a fragile determinism that depends on the scheduler implementation. If we leave this alone, Hyrum's Law will lead to tests that depend on the details of the scheduler implementation, making the scheduler more difficult to change in the future. We've successfully defended against this before through intentional randomization, most notably in map iteration and the select
poll order. We should do the same for synctest
and defend against Hyrum's Law by introducing intentional randomization in the selection of which runnable goroutine to run when inside a bubble. We already do this in -race
mode and can probably reuse that same mechanism.
cc @neild , @golang/runtime
Metadata
Metadata
Assignees
Labels
Type
Projects
Status