dawn/node: Fail tests where the process aborted abnormally.

If the process exits with a non-zero status (like crashing), then don't pretend the test passed.
This would only occur if the test result had already been printed.

Change-Id: I29e81362b6e09f1fca48c55b1798ba409e9a703e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95942
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Ben Clayton 2022-07-12 12:53:09 +00:00 committed by Dawn LUCI CQ
parent 66d4f6e6fb
commit 7fe690b555
1 changed files with 3 additions and 1 deletions

View File

@ -972,7 +972,9 @@ func (r *runner) runTestcase(query string) result {
msg := buf.String() msg := buf.String()
switch { switch {
case errors.Is(err, context.DeadlineExceeded): case errors.Is(err, context.DeadlineExceeded):
return result{testcase: query, status: timeout, message: msg} return result{testcase: query, status: timeout, message: msg, error: err}
case err != nil:
break
case strings.Contains(msg, "[fail]"): case strings.Contains(msg, "[fail]"):
return result{testcase: query, status: fail, message: msg} return result{testcase: query, status: fail, message: msg}
case strings.Contains(msg, "[warn]"): case strings.Contains(msg, "[warn]"):