Skip to content

Commit

Permalink
Enable faulthandler to dump stack on critical failure (#8207)
Browse files Browse the repository at this point in the history
With luck, will dump on signals and help us get a backtrace.
  • Loading branch information
mmastrac authored Jan 13, 2025
1 parent b60c5b8 commit 04809b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions edb/tools/test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import csv
import dataclasses
import enum
import faulthandler
import io
import itertools
import json
Expand Down Expand Up @@ -69,6 +70,8 @@
py_hash_secret: bytes = cpython_state.get_py_hash_secret()
py_random_seed: bytes = random.SystemRandom().randbytes(8)

faulthandler.enable(file=sys.stderr, all_threads=True)


def teardown_suite() -> None:
# The TestSuite methods are mutating the *result* object,
Expand All @@ -92,6 +95,10 @@ def init_worker(
global py_hash_secret
global py_random_seed

faulthandler.enable(file=sys.stderr, all_threads=True)
# If we're still running after 30 minutes, dump the traceback.
faulthandler.dump_traceback_later(30 * 60, file=sys.stderr)

if additional_init:
additional_init()

Expand Down

0 comments on commit 04809b5

Please sign in to comment.