Skip to content

Commit 409b1e6

Browse files
committed
test(chaos): say why short_gap_collision is bounded by state
Follow-up comment to the previous commit, which made the collision ordering explicit. The case table now records what the bound rests on and what failed before it, so the next reader does not re-derive it from the runner. No value changed.
1 parent 25f9c7b commit 409b1e6

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

internal/chaos/inprocess/runner_test.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,20 @@ func TestInProcessDisconnectReconnect(t *testing.T) {
269269
minDisconnected int
270270
}{
271271
{
272-
name: "short_gap_collision",
273-
reconnectDelay: 0, // Collision mode: queue new conn before closing old.
274-
duration: 15 * time.Second, // Session is ESTABLISHED when new conn arrives.
275-
minEstablished: 1, // Initial session only — collision rejects the new one.
276-
maxEstablished: 1, // RFC 4271 §6.8: ESTABLISHED state rejects incoming.
277-
minDisconnected: 0, // Disconnect events vary by timing.
272+
name: "short_gap_collision",
273+
// Collision mode. The runner delivers the new connection while the
274+
// reactor reports the peer ESTABLISHED and closes the old one only
275+
// after the reactor has refused the new one, so the count below is
276+
// bounded by the session's state, not by how the Go scheduler
277+
// happened to order the accept handler against the old connection's
278+
// EOF. Before that ordering was made explicit, losing the race let
279+
// the new connection establish a SECOND session and this case failed
280+
// "2 is not less than or equal to 1" on a slow host.
281+
reconnectDelay: 0,
282+
duration: 15 * time.Second,
283+
minEstablished: 1, // Initial session only — collision rejects the new one.
284+
maxEstablished: 1, // RFC 4271 §6.8: ESTABLISHED state rejects incoming.
285+
minDisconnected: 0, // Disconnect events vary by timing.
278286
},
279287
{
280288
name: "borderline_gap",

0 commit comments

Comments
 (0)