Skip to content

Commit

Permalink
Revert "Reland "Use gtest_parallel with 1 worker for webrtc_perf_test…
Browse files Browse the repository at this point in the history
…s.""

This reverts commit c31fc2a.

Reason for revert: Fix is not working properly.

Original change's description:
> Reland "Use gtest_parallel with 1 worker for webrtc_perf_tests."
>
> This is a reland of 258ed1a
>
> Original change's description:
> > Use gtest_parallel with 1 worker for webrtc_perf_tests.
> >
> > This will enable test results to be uploaded to ResultDB.
> >
> > Bug: b/197492097
> > Change-Id: Iec28520c4cd8f35fcff2cbd105a4b851ef41b9fc
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239641
> > Reviewed-by: Mirko Bonadei <[email protected]>
> > Reviewed-by: Christoffer Jansson <[email protected]>
> > Commit-Queue: Jeremy Leconte <[email protected]>
> > Cr-Commit-Position: refs/heads/main@{#35458}
>
> Bug: b/197492097
> No-Presubmit: True
> Change-Id: Iea90f5698c83791d39c0f6da666c1d1eb274edd3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239645
> Commit-Queue: Jeremy Leconte <[email protected]>
> Reviewed-by: Andrey Logvin <[email protected]>
> Reviewed-by: Christoffer Jansson <[email protected]>
> Reviewed-by: Jakob Ivarsson <[email protected]>
> Reviewed-by: Gustaf Ullberg <[email protected]>
> Reviewed-by: Mirko Bonadei <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#35483}

[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]

Change-Id: Iee9b67db99545a1e6c707bc03faaf55afc90cbbf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/197492097
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/240182
Reviewed-by: Mirko Bonadei <[email protected]>
Owners-Override: Mirko Bonadei <[email protected]>
Commit-Queue: Mirko Bonadei <[email protected]>
Cr-Commit-Position: refs/heads/main@{#35486}
  • Loading branch information
Jeremy Leconte authored and WebRTC LUCI CQ committed Dec 7, 2021
1 parent bf28797 commit a2e3d80
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 67 deletions.
24 changes: 9 additions & 15 deletions audio/test/low_bandwidth_audio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
'To fix this run:\n'
' python %s %s\n'
'\n'
'Note that these tools are Google-internal due to licensing, so in order '
'to use them you will have to get your own license and manually put them '
'in the right location.\n'
'Note that these tools are Google-internal due to licensing, so in order to '
'use them you will have to get your own license and manually put them in the '
'right location.\n'
'See https://cs.chromium.org/chromium/src/third_party/webrtc/tools_webrtc/'
'download_tools.py?rcl=bbceb76f540159e2dba0701ac03c514f01624130&l=13')

Expand Down Expand Up @@ -65,9 +65,6 @@ def _ParseArgs():
'--isolated-script-test-perf-output',
default=None,
help='Path to store perf results in histogram proto format.')
parser.add_argument('--dump_json_test_results',
default=None,
help='Path to store json test results.')
parser.add_argument('--extra-test-args',
default=[],
action='append',
Expand Down Expand Up @@ -245,14 +242,14 @@ def _ConfigurePythonPath(args):
checkout_root = os.path.abspath(
os.path.join(script_dir, os.pardir, os.pardir))

# TODO(https://crbug.com/1029452): Use a copy rule and add these from the
# out dir like for the third_party/protobuf code.
# TODO(https://crbug.com/1029452): Use a copy rule and add these from the out
# dir like for the third_party/protobuf code.
sys.path.insert(
0, os.path.join(checkout_root, 'third_party', 'catapult', 'tracing'))

# The low_bandwidth_audio_perf_test gn rule will build the protobuf stub
# for python, so put it in the path for this script before we attempt to
# import it.
# The low_bandwidth_audio_perf_test gn rule will build the protobuf stub for
# python, so put it in the path for this script before we attempt to import
# it.
histogram_proto_path = os.path.join(os.path.abspath(args.build_dir),
'pyproto', 'tracing', 'tracing',
'proto')
Expand Down Expand Up @@ -299,10 +296,7 @@ def main():
]
else:
test_command = [
os.path.join('..', '..', 'tools_webrtc',
'gtest-parallel-wrapper.py'),
os.path.join(args.build_dir, 'low_bandwidth_audio_test'),
'--dump_json_test_results=%s' % args.dump_json_test_results,
os.path.join(args.build_dir, 'low_bandwidth_audio_test')
]

analyzers = [Analyzer('pesq', _RunPesq, pesq_path, 16000)]
Expand Down
2 changes: 1 addition & 1 deletion test/testsupport/perf_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void PrintPlottableResults(const std::vector<std::string>& desired_graphs) {
bool WritePerfResults(const std::string& output_path) {
std::string results = GetPerfResults();
CreateDir(DirName(output_path));
FILE* output = fopen(output_path.c_str(), "ab");
FILE* output = fopen(output_path.c_str(), "wb");
if (output == NULL) {
printf("Failed to write to %s.\n", output_path.c_str());
return false;
Expand Down
55 changes: 30 additions & 25 deletions tools_webrtc/mb/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,22 +906,14 @@ def GetSwarmingCommand(self, target, vals):
extra_files = [
'../../.vpython',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
]
vpython_exe = 'vpython'
#TODO(crbug.com/webrtc/13475) : use os.path module instead of 'sep'.
sep = '\\' if self.platform == 'win32' else '/'
output_dir = '${ISOLATED_OUTDIR}' + sep + 'test_logs'
test_results = '${ISOLATED_OUTDIR}' + sep + 'gtest_output.json'

must_retry = False
if test_type == 'script':
cmdline += [vpython_exe,
'../../' +
self.ToSrcRelPath(isolate_map[target]['script']),
'--dump_json_test_results=%s' % test_results]
self.ToSrcRelPath(isolate_map[target]['script'])]
elif is_android:
cmdline += [vpython_exe,
'../../build/android/test_wrapper/logdog_wrapper.py',
Expand All @@ -930,6 +922,11 @@ def GetSwarmingCommand(self, target, vals):
'--logcat-output-file', '${ISOLATED_OUTDIR}/logcats',
'--store-tombstones']
else:
if test_type == 'raw':
cmdline += [vpython_exe,
'../../tools_webrtc/flags_compatibility.py']
extra_files.append('../../tools_webrtc/flags_compatibility.py')

if isolate_map[target].get('use_webcam', False):
cmdline += [vpython_exe,
'../../tools_webrtc/ensure_webcam_is_running.py']
Expand All @@ -946,25 +943,33 @@ def GetSwarmingCommand(self, target, vals):
else:
cmdline += [vpython_exe, '../../testing/test_env.py']

cmdline += [
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=%s' % output_dir,
'--dump_json_test_results=%s' % test_results,
'--gtest_color=no',
]
if test_type != 'raw':
# We tell gtest-parallel to interrupt the test after 900
# seconds, so it can exit cleanly and report results,
# instead of being interrupted by swarming and not
# reporting anything.
extra_files += [
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
]
sep = '\\' if self.platform == 'win32' else '/'
output_dir = '${ISOLATED_OUTDIR}' + sep + 'test_logs'
test_results = '${ISOLATED_OUTDIR}' + sep + 'gtest_output.json'
timeout = isolate_map[target].get('timeout', 900)
cmdline.append('--timeout=%s' % timeout)
cmdline += [
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=%s' % output_dir,
'--dump_json_test_results=%s' % test_results,
'--gtest_color=no',
# We tell gtest-parallel to interrupt the test after 900
# seconds, so it can exit cleanly and report results,
# instead of being interrupted by swarming and not
# reporting anything.
'--timeout=%s' % timeout,
]
if test_type == 'non_parallel_console_test_launcher':
# Still use the gtest-parallel-wrapper.py script since we
# need it to run tests on swarming, but don't execute tests
# in parallel.
cmdline.append('--workers=1')
must_retry = True
if test_type in ('raw', 'non_parallel_console_test_launcher'):
# Still use the gtest-parallel-wrapper.py script since we
# need it to run tests on swarming, but don't execute tests
# in parallel.
cmdline.append('--workers=1')

asan = 'is_asan=true' in vals['gn_args']
lsan = 'is_lsan=true' in vals['gn_args']
Expand Down
33 changes: 7 additions & 26 deletions tools_webrtc/mb/mb_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,8 @@ def test_gen_swarming_android(self):
files = isolate_file_contents['variables']['files']
command = isolate_file_contents['variables']['command']

self.assertEqual(files, [
'../../.vpython', '../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'base_unittests',
])
self.assertEqual(files, ['../../.vpython', '../../testing/test_env.py',
'base_unittests'])
self.assertEqual(command, [
'vpython',
'../../build/android/test_wrapper/logdog_wrapper.py',
Expand Down Expand Up @@ -372,13 +367,8 @@ def test_gen_swarming_android_junit_test(self):
files = isolate_file_contents['variables']['files']
command = isolate_file_contents['variables']['command']

self.assertEqual(files, [
'../../.vpython', '../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'base_unittests',
])
self.assertEqual(files, ['../../.vpython', '../../testing/test_env.py',
'base_unittests'])
self.assertEqual(command, [
'vpython',
'../../build/android/test_wrapper/logdog_wrapper.py',
Expand Down Expand Up @@ -467,15 +457,11 @@ def test_gen_script(self):

self.assertEqual(files, [
'../../.vpython', '../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'base_unittests', 'base_unittests_script.py',
])
self.assertEqual(command, [
'vpython',
'../../base/base_unittests_script.py',
'--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
])

def test_gen_raw(self):
Expand Down Expand Up @@ -505,19 +491,14 @@ def test_gen_raw(self):
self.assertEqual(files, [
'../../.vpython',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'../../tools_webrtc/flags_compatibility.py',
'base_unittests',
])
self.assertEqual(command, [
'vpython',
'../../tools_webrtc/flags_compatibility.py',
'vpython',
'../../testing/test_env.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}/test_logs',
'--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
'--gtest_color=no',
'--workers=1',
'./base_unittests',
'--asan=0',
'--lsan=0',
Expand Down

0 comments on commit a2e3d80

Please sign in to comment.