summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedict Wong <benedictwong@google.com>2018-10-31 17:52:14 -0700
committerMaciej Żenczykowski <maze@google.com>2020-09-23 04:54:56 +0000
commit8eb09e6c541881a9eff7ebe4358463f4d3b10a83 (patch)
treeb74c79e5a88bcc4eac72a85a92db42c59fac3e1e
parentf1a12c86506fd5faff559aef0aa2fcef81f2553e (diff)
downloadtests-8eb09e6c541881a9eff7ebe4358463f4d3b10a83.tar.gz
Use blocking sockets with timeout for xfrm_tunnel_test
Using non-blocking sockets appears to be causing flakiness due to the tests racing against the kernel's crypto/networking infrastructure. This commit allows these sockets to block for up to 500ms to allow time for the crypto and routing to complete before throwing errors. Bug: 118753529 Test: Run 20x locally, via QEMU; passing. Change-Id: I92a39f8890244ebe918f48bcf0971e85795b2a1e Merged-In: I92a39f8890244ebe918f48bcf0971e85795b2a1e
-rwxr-xr-xnet/test/xfrm_tunnel_test.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/test/xfrm_tunnel_test.py b/net/test/xfrm_tunnel_test.py
index 5f243cc..20a8584 100755
--- a/net/test/xfrm_tunnel_test.py
+++ b/net/test/xfrm_tunnel_test.py
@@ -109,7 +109,7 @@ def _CreateReceiveSock(version, port=0):
# The second parameter of the tuple is the port number regardless of AF.
local_port = read_sock.getsockname()[1]
# Guard against the eventuality of the receive failing.
- net_test.SetNonBlocking(read_sock.fileno())
+ csocket.SetSocketTimeout(read_sock, 500)
return read_sock, local_port