fix race condition in the TLS extension handler test

This commit is contained in:
Marten Seemann
2020-02-25 15:06:01 +07:00
parent d277e013ab
commit 25b3eb8a37

View File

@@ -84,12 +84,15 @@ var _ = Describe("TLS Extension Handler, for the server", func() {
})
It("ignores extensions that are not sent with the ClientHello", func() {
done := make(chan struct{})
go func() {
defer GinkgoRecover()
handlerServer.ReceivedExtensions(uint8(typeFinished), chExts)
close(done)
}()
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() {
done := make(chan struct{})
go func() {
defer GinkgoRecover()
handlerClient.ReceivedExtensions(uint8(typeFinished), chExts)
close(done)
}()
Consistently(handlerClient.TransportParameters()).ShouldNot(Receive())
Eventually(done).Should(BeClosed())
})
})
})