diff --git a/audio/test/low_bandwidth_audio_test.py b/audio/test/low_bandwidth_audio_test.py index b663985bf0..62c3adf539 100755 --- a/audio/test/low_bandwidth_audio_test.py +++ b/audio/test/low_bandwidth_audio_test.py @@ -55,6 +55,8 @@ def _ParseArgs(): parser.add_argument('--android', action='store_true', help='Perform the test on a connected Android device instead.') parser.add_argument('--adb-path', help='Path to adb binary.', default='adb') + parser.add_argument('--num-retries', default=0, + help='Number of times to retry the test on Android.') parser.add_argument('--isolated-script-test-perf-output', help='Where to store perf results in chartjson format.', default=None) @@ -221,7 +223,8 @@ def main(): out_dir = os.path.join(args.build_dir, '..') if args.android: test_command = [os.path.join(args.build_dir, 'bin', - 'run_low_bandwidth_audio_test'), '-v'] + 'run_low_bandwidth_audio_test'), + '-v', '--num-retries', args.num_retries] else: test_command = [os.path.join(args.build_dir, 'low_bandwidth_audio_test')] diff --git a/examples/androidtests/video_quality_loopback_test.py b/examples/androidtests/video_quality_loopback_test.py index ce10ee6ef0..66a981bd83 100755 --- a/examples/androidtests/video_quality_loopback_test.py +++ b/examples/androidtests/video_quality_loopback_test.py @@ -86,6 +86,8 @@ def _ParseArgs(): parser.add_argument('--temp_dir', help='A temporary directory to put the output.') parser.add_argument('--adb-path', help='Path to adb binary.', default='adb') + parser.add_argument('--num-retries', default=0, + help='Number of times to retry the test on Android.') parser.add_argument('--isolated-script-test-perf-output', help='Where to store perf results in chartjson format.', default=None) @@ -160,7 +162,7 @@ def SetUpTools(android_device, temp_dir, processes): '8089'])) -def RunTest(android_device, adb_path, build_dir, temp_dir, +def RunTest(android_device, adb_path, build_dir, temp_dir, num_retries, chartjson_result_file): ffmpeg_path = os.path.join(TOOLCHAIN_DIR, 'ffmpeg') def ConvertVideo(input_video, output_video): @@ -169,7 +171,8 @@ def RunTest(android_device, adb_path, build_dir, temp_dir, # Start loopback call and record video. test_script = os.path.join( build_dir, 'bin', 'run_AppRTCMobileTestStubbedVideoIO') - _RunCommand([test_script, '--device', android_device]) + _RunCommand([test_script, '--device', android_device, + '--num-retries', num_retries]) # Pull the recorded video. test_video = os.path.join(temp_dir, 'test_video.y4m') @@ -225,7 +228,7 @@ def main(): try: android_device = SelectAndroidDevice(adb_path) SetUpTools(android_device, temp_dir, processes) - RunTest(android_device, adb_path, build_dir, temp_dir, + RunTest(android_device, adb_path, build_dir, temp_dir, args.num_retries, args.isolated_script_test_perf_output) finally: for process in processes: