Skip to content

Commit f2f6c0b

Browse files
committed
[run_cperf] Tolerate test failures, mention them in report.
1 parent 22607ed commit f2f6c0b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

run_cperf

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def main():
8989
with open(ws_comment, 'w') as f:
9090
f.write("Compilation-performance test failed")
9191

92+
failures = []
9293
for instance in instances:
9394
workspace = get_workspace_for_instance(instance, args)
9495

@@ -100,9 +101,9 @@ def main():
100101
build_swift_toolchain(workspace, args)
101102

102103
if not args.skip_runner:
103-
execute_runner(instance, workspace, configs, args)
104+
failures += execute_runner(instance, workspace, configs, args)
104105

105-
regressions = analyze_results(configs, args)
106+
regressions = analyze_results(configs, failures, args)
106107

107108
# Crude hack to write output to workspace when in CI,
108109
# regardless of --output passed.
@@ -272,6 +273,7 @@ def get_variant(config, args):
272273
def execute_runner(instance, workspace, configs, args):
273274
projects = get_projects(args.suite)
274275
swiftc_path = get_swiftc_path(instance, workspace, args)
276+
failures = []
275277
for config in configs:
276278
variant = get_variant(config, args)
277279
stats = get_stats_dir(instance, variant)
@@ -297,7 +299,14 @@ def execute_runner(instance, workspace, configs, args):
297299
runner_command += get_sandbox_profile_flags()
298300
if args.verbose:
299301
runner_command += ["--verbose"]
300-
common.check_execute(runner_command, timeout=9999999)
302+
try:
303+
common.check_execute(runner_command, timeout=9999999)
304+
except common.ExecuteCommandFailure:
305+
fail_logs = [ re.sub('FAIL_.*_(\\w+).log', '\\1', n)
306+
for n in os.listdir(".")
307+
if re.match('FAIL.*.log', n)]
308+
failures += (fail_logs if len(fail_logs) != 0 else ["unknown"])
309+
return failures
301310

302311

303312
def get_table_name(reference, subset, variant):
@@ -341,7 +350,7 @@ def get_baseline_name(variant):
341350
'cperf-baselines', variant + '.csv')
342351

343352

344-
def analyze_results(configs, args):
353+
def analyze_results(configs, failures, args):
345354
# Make a separate random run_id for each comment, to uniquify links.
346355
run_id = hex(random.randint(1, 2**63))[2:]
347356
old_ws = get_workspace_for_instance(OLD_INSTANCE, args)
@@ -396,6 +405,9 @@ def analyze_results(configs, args):
396405
out = args.output
397406
regressions = any(x != 0 for x in returncodes)
398407
out.write("# Summary for %s %s\n\n" % (args.swift_branch, args.suite))
408+
if len(failures) != 0:
409+
out.write("**Unexpected test results, stats may be off for %s**\n\n" %
410+
", ".join(set(failures)))
399411
if regressions:
400412
out.write("**Regressions found (see below)**\n\n")
401413
else:

0 commit comments

Comments
 (0)