[SDK] Fixes crash in tools/run_abi_tests.py

logRecords is expected to be of type dict, but the fallback value
was previously set to [] (type list).

This CL changes the fallback values to an empty dict.
It also uses the builtin dict.get() to handle to fallback instead
of manually doing so.

Note: This CL will not make the bot go green.
It will change it from purple (infra failure due to crash) to red
since there are tests that are legitimately failing.

Bug: https://github.com/dart-lang/sdk/issues/42625
Cq-Include-Trybots: dart/try:vm-dartkb-linux-release-x64-abi-try
Change-Id: I12ad7688719039566cd16e128997f0f8efc60a69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153600
Commit-Queue: Clement Skau <cskau@google.com>
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Clement Skau 2020-07-08 09:56:04 +00:00 committed by commit-bot@chromium.org
parent 2e5e03fe8d
commit fcbf5341f0

View file

@ -195,7 +195,7 @@ def diffAllResults(tests, flags):
flags.configuration_name)
resultFile.write(json.dumps(outResult) + '\n')
if diffs:
logRecords = allLogs[name] if name in allLogs else []
logRecords = allLogs.get(name, {})
logFile.write(
json.dumps(
makeLog(diffs, results, logRecords, flags.