Commit 09aa4b94 authored by Wenbin Zhang's avatar Wenbin Zhang Committed by Commit Bot

[benchmarking] fix the use of all() when checking skipped tests

When the test is terminated for some reason, the test result list is empty. The current usage of all() to check the empty list will return true, and thus incorrectly interpretted as 'all tests are skipped'.

This CL added a check to the list itself before calling all().

Bug: chromium:1136140
Change-Id: I308ee8cd21a611b6e7f25c0996cdf3528d7ebe1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2458886
Auto-Submit: Wenbin Zhang <wenbinzhang@google.com>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814901}
parent 8ef58b89
...@@ -169,7 +169,7 @@ def GenerateExitCode(test_results): ...@@ -169,7 +169,7 @@ def GenerateExitCode(test_results):
""" """
if any(r['status'] == 'FAIL' for r in test_results): if any(r['status'] == 'FAIL' for r in test_results):
return 1 return 1
if all(r['status'] == 'SKIP' for r in test_results): if test_results and all(r['status'] == 'SKIP' for r in test_results):
return 111 return 111
return 0 return 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment