File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 88import re
99import secrets
1010import shutil
11+ import signal
1112import socket
1213import subprocess
1314import sys
1415import threading
1516import time
17+ import traceback
1618from functools import partial
1719from pathlib import Path
1820from typing import Dict , List , Optional
@@ -76,6 +78,22 @@ def pytest_addoption(parser):
7678 'is uploaded to the test aggregation server. ' )
7779
7880
81+ def debug (sig , frame ):
82+ with open ('/tmp/python-dump.txt' , 'w' ) as f :
83+ f .write ('Test' )
84+ try :
85+ for thr in threading .enumerate ():
86+ f .write (str (thr ))
87+ f .write ('\n ' )
88+ traceback .print_stack (sys ._current_frames ()[thr .ident ], file = f )
89+ f .write ('\n \n ' )
90+ except Exception as ex :
91+ f .write (str (ex ))
92+
93+
94+ signal .signal (signal .SIGUSR1 , debug ) # Register handler
95+
96+
7997def _get_executors (config : Dict [str , str ]) -> List [str ]:
8098 execs_str = config .getoption ('executors' )
8199 execs = execs_str .split (',' )
You can’t perform that action at this time.
0 commit comments