]> Cypherpunks.ru repositories - gostls13.git/commit
net: use synthetic network in TestDialParallel
authorDamien Neil <dneil@google.com>
Mon, 6 Jun 2022 22:52:19 +0000 (15:52 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 7 Jun 2022 22:24:02 +0000 (22:24 +0000)
commita7551fe24524fb960fbe4cd74dae13afe9ca6a5c
treebd9437ba0e688b7e111f9aeacc7b213653b6cc45
parent19d71acd978891b201bc5ce79bdcd20b36d04a2e
net: use synthetic network in TestDialParallel

TestDialParallel is testing the Happy Eyeballs algorithm implementation,
which dials IPv4 and IPv6 addresses in parallel with the preferred
address family getting a head start. This test doesn't care about
the actual network operations, just the handling of the parallel
connections.

Use testHookDialTCP to replace socket creation with a function that
returns successfully, with an error, or after context cancellation
as required.

Limit tests of elapsed times to a check that the fallback deadline
has been exceeded in cases where this is expected.

This should fix persistent test flakiness.

Fixes #52173.

Change-Id: Ic93f270fccb63b24a91105a4d541479fc33a2de4
Reviewed-on: https://go-review.googlesource.com/c/go/+/410754
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/net/dial_test.go