[fuzzing, coverage] Update run_all_fuzzers to gracefully handle
timeouts.

We expect a small portion of fuzzers to time out and require re-running
for various reasons; however, the TimeoutExpired exception type has no
.returncode value, so we should log them differently.

Change-Id: Ieb8b17d60e8b8db89edf7fbf3ae2ea75df9a611c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4641540
Reviewed-by: Prakhar Asthana <pasthana@google.com>
Commit-Queue: Julia Hansbrough <flowerhack@google.com>
Cr-Commit-Position: refs/heads/main@{#1162008}
diff --git a/tools/code_coverage/run_all_fuzzers.py b/tools/code_coverage/run_all_fuzzers.py
index 2da785bd..f219c22 100644
--- a/tools/code_coverage/run_all_fuzzers.py
+++ b/tools/code_coverage/run_all_fuzzers.py
@@ -48,11 +48,14 @@
       print(
           "Command %s exited with non-zero return code, failing on iteration %d"
           % (cmd, i))
-      print("Return code: " + str(e.returncode))
-      print("**** FULL FUZZING OUTPUT BELOW ***")
-      print(e.output)
-      print(e.stderr)
-      print("*** FULL FUZZING OUTPUT ABOVE ***")
+      if type(e) == subprocess.TimeoutExpired:
+        print("Timed out after %d seconds" % e.timeout)
+      else:
+        print("Return code: " + str(e.returncode))
+        print("**** FULL FUZZING OUTPUT BELOW ***")
+        print(e.output)
+        print(e.stderr)
+        print("*** FULL FUZZING OUTPUT ABOVE ***")
   if not os.path.isfile(target_profraw):
     failed_targets.append(target)
     return