Deflake socket_ipv4_udp_unbound_loopback.

When run in parallel, multicast packets can be received by the wrong test. The
tests in the target are run in an isolated network namespace, but if
parallelism is enabled, multiple tests from the same target will run in
parallel within the target's network namespace. Disabling parallelism only
allows one test to run in the network namespace at a time, which prevents
interaction.

PiperOrigin-RevId: 236709160
Change-Id: If828db44f0ae4002af36de6097866137c8d9da5c
This commit is contained in:
Ian Gudger 2019-03-04 13:03:50 -08:00 committed by Shentubot
parent 4bb1d5efb1
commit 2d613f8e30
2 changed files with 21 additions and 11 deletions

View File

@ -364,8 +364,8 @@ syscall_test(
)
syscall_test(
# FIXME
tags = ["flaky"],
# Multicast packets can be received by the wrong test if run in parallel.
parallel = False,
test = "//test/syscalls/linux:socket_ipv4_udp_unbound_loopback_test",
)

View File

@ -7,7 +7,8 @@ def syscall_test(
shard_count = 1,
size = "small",
use_tmpfs = False,
tags = None):
tags = None,
parallel = True):
_syscall_test(
test = test,
shard_count = shard_count,
@ -15,6 +16,7 @@ def syscall_test(
platform = "native",
use_tmpfs = False,
tags = tags,
parallel = parallel,
)
_syscall_test(
@ -24,6 +26,7 @@ def syscall_test(
platform = "kvm",
use_tmpfs = use_tmpfs,
tags = tags,
parallel = parallel,
)
_syscall_test(
@ -33,6 +36,7 @@ def syscall_test(
platform = "ptrace",
use_tmpfs = use_tmpfs,
tags = tags,
parallel = parallel,
)
if not use_tmpfs:
@ -44,6 +48,7 @@ def syscall_test(
platform = "ptrace",
use_tmpfs = use_tmpfs,
tags = tags,
parallel = parallel,
file_access = "shared",
)
@ -54,6 +59,7 @@ def _syscall_test(
platform,
use_tmpfs,
tags,
parallel,
file_access = "exclusive"):
test_name = test.split(":")[1]
@ -80,6 +86,17 @@ def _syscall_test(
if platform == "kvm":
tags += ["manual"]
args = [
# Arguments are passed directly to syscall_test_runner binary.
"--test-name=" + test_name,
"--platform=" + platform,
"--use-tmpfs=" + str(use_tmpfs),
"--file-access=" + file_access,
]
if parallel:
args += ["--parallel=true"]
sh_test(
srcs = ["syscall_test_runner.sh"],
name = name,
@ -87,14 +104,7 @@ def _syscall_test(
":syscall_test_runner",
test,
],
args = [
# Arguments are passed directly to syscall_test_runner binary.
"--test-name=" + test_name,
"--platform=" + platform,
"--use-tmpfs=" + str(use_tmpfs),
"--file-access=" + file_access,
"--parallel=true",
],
args = args,
size = size,
tags = tags,
shard_count = shard_count,