Unverified Commit 88cc3295 authored by Luiz Aoqui's avatar Luiz Aoqui
Browse files

test: remove flaky Gate test

The concurrent gate access test is flaky since it depends on the order
of operations of two concurrent goroutines. Despite the heavy bias
towards one of the results, it's still possible to end the execution
with a closed gate.

I believe this case was created to test an earlier implementation where
the gate state was stored and mutated internally, so the access had to
be protected by a lock. However, the final implementation changed this
approach to be only channel-based, so there is no need for this flaky
test anymore.
parent cac17b8b
Showing with 0 additions and 17 deletions
+0 -17
......@@ -62,23 +62,6 @@ func TestGate(t *testing.T) {
requireChannelPassing(t, g.WaitCh(), "second allow")
},
},
{
name: "concurrent access",
test: func(t *testing.T, g *Gate) {
x := 100
go func() {
for i := 0; i < x; i++ {
g.Open()
}
}()
go func() {
for i := 0; i < x/10; i++ {
g.Close()
}
}()
requireChannelPassing(t, g.WaitCh(), "gate should be open")
},
},
}
for _, tc := range testCases {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment