mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test: fix tailnet connection teardown flake (#27768)
Closes https://github.com/coder/internal/issues/1620 Closes ENG-3043 The callback cleanup added in #20687 stops new node callbacks, but it can still race with one that's already in flight. That callback may call `UpdatePeers` after the destination `tailnet.Conn` closes, so the test fails with `connection closed` even though the redirect behaviour is correct. To fix, we'll just ignore `tailnet.ErrConnClosed` in the asynchronous `stitch` helpers, whilst continuing to assert on every other error.
This commit is contained in:
@@ -243,7 +243,9 @@ func stitchTailnet(t *testing.T, conns map[uuid.UUID]*tailnet.Conn) {
|
||||
Node: protoNode,
|
||||
Kind: proto.CoordinateResponse_PeerUpdate_NODE,
|
||||
}})
|
||||
assert.NoError(t, err)
|
||||
if err != nil && !errors.Is(err, tailnet.ErrConnClosed) {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user