• Filippo Valsorda's avatar
    crypto/tls: replace net.Pipe in tests with real TCP connections · be0f3c28
    Filippo Valsorda authored
    crypto/tls is meant to work over network connections with buffering, not
    synchronous connections, as explained in #24198. Tests based on net.Pipe
    are unrealistic as reads and writes are matched one to one. Such tests
    worked just thanks to the implementation details of the tls.Conn
    internal buffering, and would break if for example the flush of the
    first flight of the server was not entirely assimilated by the client
    rawInput buffer before the client attempted to reply to the ServerHello.
    
    Note that this might run into the Darwin network issues at #25696.
    
    Fixed a few test races that were either hidden or synchronized by the
    use of the in-memory net.Pipe.
    
    Also, this gets us slightly more realistic benchmarks, reflecting some
    syscall cost of Read and Write operations.
    
    Change-Id: I5a597b3d7a81b8ccc776030cc837133412bf50f8
    Reviewed-on: https://go-review.googlesource.com/c/142817
    Run-TryBot: Filippo Valsorda <filippo@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    be0f3c28
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...