graph/flow: improve consistency of coverage reports
@@ -132,6 +132,12 @@ func (n char) ID() int64 { return int64(n) }
func (n char) String() string { return string(n) }
func TestDominators(t *testing.T) {
+ // The dominator functions are non-deterministic due
+ // to map iteration ordering, so repeat the tests to
+ // ensure consistent coverage. The value of 100 was
+ // chosen empirically to have no observed reduction
+ // in coverage in several hundred runs of go test -cover.
+ for i := 0; i < 100; i++ {
for _, test := range dominatorsTests {
g := simple.NewDirectedGraph()
for _, e := range test.edges {
@@ -184,3 +190,4 @@ func TestDominators(t *testing.T) {
}
}
}
+}
