forked from quic-go/quic-go
fix a race condition in a session test
We were relying on the run-loop to set handshakeComplete to true, while at the same time sending packets. select doesn't guarantee the order of execution when multiple cases can run. The fix is setting handshakeComplete to true directly.
This commit is contained in:
@@ -1377,7 +1377,7 @@ var _ = Describe("Session", func() {
|
||||
})
|
||||
|
||||
It("ignores undecryptable packets after the handshake is complete", func() {
|
||||
close(aeadChanged)
|
||||
sess.handshakeComplete = true
|
||||
go sess.run()
|
||||
sendUndecryptablePackets()
|
||||
Consistently(sess.undecryptablePackets).Should(BeEmpty())
|
||||
|
||||
Reference in New Issue
Block a user