]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: fix flaky handshake cancellation tests
authorJohan Brandhorst <johan.brandhorst@gmail.com>
Sun, 28 Mar 2021 15:39:47 +0000 (16:39 +0100)
committerJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Fri, 16 Apr 2021 19:23:29 +0000 (19:23 +0000)
commitef57834360cf69f2e8b52b32c7a05d96bf6bbba7
tree75727058493e299c7ae9ce4ffe25c05a01885b95
parentdba89283ad05e600defc41dbf94df91ce9027566
crypto/tls: fix flaky handshake cancellation tests

Simplified both tests significantly by removing logic for writing
the client/server side messages. The flake was likely because of a
race between the closing of the local pipe from inside the test
and closing of the pipe from within the handshakeContext goroutine.
Wait to close the local pipe in the test until after the test
has finished running.

Fixes #45106
Fixes #45299

Change-Id: If7ca75aeff7df70cda03c934fa9d8513276d465d
Reviewed-on: https://go-review.googlesource.com/c/go/+/305250
Trust: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_server_test.go