forked from quic-go/quic-go
fix race condition in the TLS extension handler test
This commit is contained in:
@@ -84,12 +84,15 @@ var _ = Describe("TLS Extension Handler, for the server", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("ignores extensions that are not sent with the ClientHello", func() {
|
It("ignores extensions that are not sent with the ClientHello", func() {
|
||||||
|
done := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
handlerServer.ReceivedExtensions(uint8(typeFinished), chExts)
|
handlerServer.ReceivedExtensions(uint8(typeFinished), chExts)
|
||||||
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
Consistently(handlerServer.TransportParameters()).ShouldNot(Receive())
|
Consistently(handlerServer.TransportParameters()).ShouldNot(Receive())
|
||||||
|
Eventually(done).Should(BeClosed())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -153,12 +156,15 @@ var _ = Describe("TLS Extension Handler, for the server", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("ignores extensions that are not sent with the EncryptedExtensions", func() {
|
It("ignores extensions that are not sent with the EncryptedExtensions", func() {
|
||||||
|
done := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
handlerClient.ReceivedExtensions(uint8(typeFinished), chExts)
|
handlerClient.ReceivedExtensions(uint8(typeFinished), chExts)
|
||||||
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
Consistently(handlerClient.TransportParameters()).ShouldNot(Receive())
|
Consistently(handlerClient.TransportParameters()).ShouldNot(Receive())
|
||||||
|
Eventually(done).Should(BeClosed())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user