diff options
author | Ian Gudger <igudger@google.com> | 2019-03-04 13:03:50 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-03-04 13:06:04 -0800 |
commit | 2d613f8e3002ef4f62b8029ba56861d73211feeb (patch) | |
tree | fd3e424fc20197c4419e77332fcdb242b3edcf70 | |
parent | 4bb1d5efb1ef3bf6a7b7ed52172acefbd52ad80d (diff) |
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
-rw-r--r-- | test/syscalls/BUILD | 4 | ||||
-rw-r--r-- | test/syscalls/build_defs.bzl | 28 |
2 files changed, 21 insertions, 11 deletions
diff --git a/test/syscalls/BUILD b/test/syscalls/BUILD index 39f1de0c9..a8fd20956 100644 --- a/test/syscalls/BUILD +++ b/test/syscalls/BUILD @@ -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", ) diff --git a/test/syscalls/build_defs.bzl b/test/syscalls/build_defs.bzl index 88777f55b..610b030b2 100644 --- a/test/syscalls/build_defs.bzl +++ b/test/syscalls/build_defs.bzl @@ -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, |