Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 382f2b2

Browse files
kjellanderCommit bot
authored andcommitted
Fix swarming tests not running in parallel
Due to recent Chrome infra changes in https://chromium-review.googlesource.com/c/472290/ tests running on swarming are now assumed to emit JSON results or will be marked as failing. This requires us to use our gtest-parallel wrapper for all our Swarming tests (or implement the --isolated-script-test-output flag, which normally only is implemented by the Chromium test launcher). The low_bandwidth_audio_test can actually run in parallel, so just change that. The webrtc_nonparallel_tests cannot, so this CL changes MB to pass --workers=1 flag to gtest-parallel, which makes the tests run in sequence. This adds a little confusion but the root problem is really that our gtest-parallel script [1] does a lot more than just running the tests in parallel these days, so it should probably be renamed. Also make sure gtest-parallel-wrapper.py [2] consumes the --isolated-script-test-chartjson-output flag (unused) so we don't pass it on to the test executable. [1]: https://chromium.googlesource.com/external/github.com/google/gtest-parallel/+/master/gtest-parallel [2]: https://chromium.googlesource.com/external/webrtc/+/master/tools-webrtc/gtest-parallel-wrapper.py BUG=709988 [email protected] NOTRY=True Review-Url: https://codereview.webrtc.org/2806373002 Cr-Commit-Position: refs/heads/master@{#17646}
1 parent 4fa0c4f commit 382f2b2

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

tools-webrtc/gtest-parallel-wrapper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def main():
5959

6060
parser = argparse.ArgumentParser()
6161
parser.add_argument('--isolated-script-test-output', type=str, default=None)
62+
63+
# TODO(ehmaldonado): Implement this flag instead of just "eating" it.
64+
parser.add_argument('--isolated-script-test-chartjson-output', type=str,
65+
default=None)
66+
6267
parser.add_argument('--output_dir', type=str, default=None)
6368
parser.add_argument('--timeout', type=int, default=None)
6469

tools-webrtc/mb/gn_isolate_map.pyl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
"low_bandwidth_audio_test": {
5151
"label": "//webrtc/audio:low_bandwidth_audio_test",
52-
"type": "non_parallel_console_test_launcher",
52+
"type": "console_test_launcher",
5353
"args": [
5454
"--quick",
5555
],

tools-webrtc/mb/mb.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,7 @@ def GetIsolateCommand(self, target, vals):
10871087
'--test',
10881088
]
10891089

1090-
gtest_parallel = (test_type != 'non_parallel_console_test_launcher' and
1091-
not memcheck)
1092-
if gtest_parallel:
1090+
if not memcheck:
10931091
extra_files += [
10941092
'../../third_party/gtest-parallel/gtest-parallel',
10951093
'../../tools-webrtc/gtest-parallel-wrapper.py',
@@ -1111,17 +1109,19 @@ def GetIsolateCommand(self, target, vals):
11111109

11121110
cmdline = (['../../testing/xvfb.py'] if xvfb else
11131111
['../../testing/test_env.py'])
1114-
if memcheck:
1115-
cmdline += memcheck_cmdline
1116-
elif gtest_parallel:
1117-
cmdline += gtest_parallel_wrapper
1118-
cmdline += [
1119-
executable,
1112+
cmdline += memcheck_cmdline if memcheck else gtest_parallel_wrapper
1113+
cmdline.append(executable)
1114+
if test_type == 'non_parallel_console_test_launcher' and not memcheck:
1115+
# Still use the gtest-parallel-wrapper.py script since we need it to
1116+
# run tests on swarming, but don't execute tests in parallel.
1117+
cmdline.append('--workers=1')
1118+
1119+
cmdline.extend([
11201120
'--',
11211121
'--asan=%d' % asan,
11221122
'--msan=%d' % msan,
11231123
'--tsan=%d' % tsan,
1124-
]
1124+
])
11251125

11261126
cmdline += isolate_map[target].get('args', [])
11271127

tools-webrtc/mb/mb_unittest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,16 @@ def test_gn_gen_non_parallel_console_test_launcher(self):
441441

442442
self.assertEqual(files, [
443443
'../../testing/test_env.py',
444+
'../../third_party/gtest-parallel/gtest-parallel',
445+
'../../tools-webrtc/gtest-parallel-wrapper.py',
444446
'base_unittests',
445447
])
446448
self.assertEqual(command, [
447449
'../../testing/test_env.py',
450+
'../../tools-webrtc/gtest-parallel-wrapper.py',
451+
'--output_dir=${ISOLATED_OUTDIR}/test_logs',
448452
'./base_unittests',
453+
'--workers=1',
449454
'--',
450455
'--asan=0',
451456
'--msan=0',

0 commit comments

Comments
 (0)