Skip to content
Snippets Groups Projects
Commit 651dd06b authored by John Chilton's avatar John Chilton
Browse files

Add thread debugging function to test_utils.

(In case I need it in the future again.)
parent 0be430fa
No related branches found
No related tags found
No related merge requests found
from __future__ import print_function
import traceback
import sys
import threading
from contextlib import contextmanager
from stat import S_IXOTH
from os import pardir, stat, chmod, access, X_OK, pathsep, environ
......@@ -408,3 +414,15 @@ def files_server(directory=None):
app = TestApp(JobFilesApp(directory))
with server_for_test_app(app) as server:
yield server
def dump_other_threads():
# Utility for debugging threads that aren't dying during
# tests.
main_thread = threading.current_thread()
for t in threading.enumerate():
if t is main_thread:
continue
print(t.getName())
traceback.print_stack(sys._current_frames()[t.ident])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment