Skip to content

Commit

Permalink
Check thread id is in current frames (#46266)
Browse files Browse the repository at this point in the history
On Chromium Windows bot, we are seeing KeyError below. Check the thread
id is in sys._current_frames() before format_stack, otherwise do not
include the stack in the error message.

Error message:
00:02:16.943 WARNING: Exception in TestExecutor.run:
  File "C:\b\s\w\ir\third_party\wpt_tools\wpt\tools\wptrunner\wptrunner\executors\base.py", line 219, in run
    message += "".join(traceback.format_stack(sys._current_frames()[executor.ident]))
KeyError: 8372
  • Loading branch information
WeizhongX committed May 15, 2024
1 parent 6929570 commit c55cca3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/wptrunner/wptrunner/executors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ def run(self):
else:
if self.protocol.is_alive():
message = "Executor hit external timeout (this may indicate a hang)\n"
# get a traceback for the current stack of the executor thread
message += "".join(traceback.format_stack(sys._current_frames()[executor.ident]))
if executor.ident in sys._current_frames():
# get a traceback for the current stack of the executor thread
message += "".join(traceback.format_stack(
sys._current_frames()[executor.ident]))
self.result = False, ("EXTERNAL-TIMEOUT", message)
else:
self.logger.info("Browser not responding, setting status to CRASH")
Expand Down

0 comments on commit c55cca3

Please sign in to comment.