Skip to content

Commit 2a3670e

Browse files
committed
Stabilize test HRR retransmission
1 parent fb3caee commit 2a3670e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

conn_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3937,7 +3937,7 @@ func testDTLS13HelloRetryRequestNetworkRecovery(
39373937
go func() { handshakeResults <- server.HandshakeContext(ctx) }()
39383938

39393939
waitForBridgePacket(t, br, 0)
3940-
br.Tick()
3940+
deliverNextBridgePacket(t, br)
39413941
waitForBridgePacket(t, br, 1)
39423942
impairNetwork(br)
39433943
br.Tick()
@@ -3960,6 +3960,14 @@ func testDTLS13HelloRetryRequestNetworkRecovery(
39603960
assertDTLSApplicationDataOverBridge(t, br, server, client, []byte("server data after HRR retry"))
39613961
}
39623962

3963+
func deliverNextBridgePacket(t *testing.T, br *test.Bridge) {
3964+
t.Helper()
3965+
3966+
require.Eventually(t, func() bool {
3967+
return br.Tick() > 0
3968+
}, time.Second, time.Millisecond, "timed out delivering bridge packet")
3969+
}
3970+
39633971
func waitForBridgeHandshakes(
39643972
t *testing.T,
39653973
ctx context.Context,

0 commit comments

Comments
 (0)