mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-03 14:09:33 +03:00
android_helper cleanup: remove smoke test and timeout
This was added to help debug cases of stuck tests on bots, but this doesn't seem to have happened in over a year and the code (and timeout) keeps getting in the way. Bug: angleproject:7242 Change-Id: Ic30d976408bd32a745d830921f6e4d98d17e863c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4789845 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
This commit is contained in:
@@ -429,40 +429,6 @@ def _RunInstrumentation(flags):
|
||||
return _ReadDeviceFile(temp_device_file)
|
||||
|
||||
|
||||
def _DumpDebugInfo(since_time):
|
||||
logcat_output = _AdbRun(['logcat', '-t', since_time]).decode()
|
||||
logging.info('logcat:\n%s', logcat_output)
|
||||
|
||||
pid_lines = [
|
||||
ln for ln in logcat_output.split('\n')
|
||||
if 'org.chromium.native_test.NativeTest.StdoutFile' in ln
|
||||
]
|
||||
if pid_lines:
|
||||
debuggerd_output = _AdbShell('debuggerd %s' % pid_lines[-1].split(' ')[2]).decode()
|
||||
logging.warning('debuggerd output:\n%s', debuggerd_output)
|
||||
|
||||
|
||||
def _RunInstrumentationWithTimeout(flags, timeout):
|
||||
initial_time = _AdbShell('date +"%F %T.%3N"').decode().strip()
|
||||
|
||||
results = []
|
||||
|
||||
def run():
|
||||
results.append(_RunInstrumentation(flags))
|
||||
|
||||
t = threading.Thread(target=run)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
t.join(timeout=timeout)
|
||||
|
||||
if t.is_alive(): # join timed out
|
||||
logging.warning('Timed out, dumping debug info')
|
||||
_DumpDebugInfo(since_time=initial_time)
|
||||
raise TimeoutError('Test run did not finish in %s seconds' % timeout)
|
||||
|
||||
return results[0]
|
||||
|
||||
|
||||
def AngleSystemInfo(args):
|
||||
_EnsureTestSuite('angle_system_info_test')
|
||||
|
||||
@@ -496,40 +462,6 @@ def _RemoveFlag(args, f):
|
||||
return original_value
|
||||
|
||||
|
||||
def RunSmokeTest():
|
||||
_EnsureTestSuite(ANGLE_TRACE_TEST_SUITE)
|
||||
|
||||
test_name = 'TraceTest.words_with_friends_2'
|
||||
run_instrumentation_timeout = 60
|
||||
|
||||
logging.info('Running smoke test (%s)', test_name)
|
||||
|
||||
trace_name = GetTraceFromTestName(test_name)
|
||||
if not trace_name:
|
||||
raise Exception('Cannot find trace name from %s.' % test_name)
|
||||
|
||||
PrepareRestrictedTraces([trace_name])
|
||||
|
||||
with _TempDeviceFile() as device_test_output_path:
|
||||
flags = [
|
||||
'--gtest_filter=' + test_name, '--no-warmup', '--steps-per-trial', '1', '--trials',
|
||||
'1', '--isolated-script-test-output=' + device_test_output_path
|
||||
]
|
||||
try:
|
||||
output = _RunInstrumentationWithTimeout(flags, run_instrumentation_timeout)
|
||||
except TimeoutError:
|
||||
raise Exception('Smoke test did not finish in %s seconds' %
|
||||
run_instrumentation_timeout)
|
||||
|
||||
test_output = _ReadDeviceFile(device_test_output_path)
|
||||
|
||||
output_json = json.loads(test_output)
|
||||
if output_json['tests'][test_name]['actual'] != 'PASS':
|
||||
raise Exception('Smoke test (%s) failed. Output:\n%s' % (test_name, output))
|
||||
|
||||
logging.info('Smoke test passed')
|
||||
|
||||
|
||||
def RunTests(test_suite, args, stdoutfile=None, log_output=True):
|
||||
_EnsureTestSuite(test_suite)
|
||||
|
||||
@@ -554,7 +486,7 @@ def RunTests(test_suite, args, stdoutfile=None, log_output=True):
|
||||
device_output_dir = stack.enter_context(_TempDeviceDir())
|
||||
args.append('--render-test-output-dir=' + device_output_dir)
|
||||
|
||||
output = _RunInstrumentationWithTimeout(args, timeout=10 * 60)
|
||||
output = _RunInstrumentation(args)
|
||||
|
||||
if '--list-tests' in args:
|
||||
# When listing tests, there may be no output file. We parse stdout anyways.
|
||||
|
||||
@@ -355,9 +355,6 @@ def sha256(path):
|
||||
def _run_tests(args, tests, extra_flags, env, screenshot_dir, results, test_results):
|
||||
keys = get_skia_gold_keys(args, env)
|
||||
|
||||
if angle_test_util.IsAndroid() and args.test_suite == DEFAULT_TEST_SUITE:
|
||||
android_helper.RunSmokeTest()
|
||||
|
||||
with temporary_dir('angle_skia_gold_') as skia_gold_temp_dir:
|
||||
gold_properties = angle_skia_gold_properties.ANGLESkiaGoldProperties(args)
|
||||
gold_session_manager = angle_skia_gold_session_manager.ANGLESkiaGoldSessionManager(
|
||||
|
||||
@@ -642,9 +642,6 @@ def main():
|
||||
logging.error('No tests to run.')
|
||||
return EXIT_FAILURE
|
||||
|
||||
if angle_test_util.IsAndroid() and args.test_suite == android_helper.ANGLE_TRACE_TEST_SUITE:
|
||||
android_helper.RunSmokeTest()
|
||||
|
||||
logging.info('Running %d test%s' % (len(tests), 's' if len(tests) > 1 else ' '))
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user