aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/test.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-11 19:52:24 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-11 19:52:24 +1200
commit09edbd9492e59c0c8dcae69b4b1f4b745867abe4 (patch)
treee9cf29c394334c02d908058c2c5e159715d3e3c3 /pathod/test.py
parent5b9f07c81c0dcc8c7b3d7afdeae8f6229ebf8622 (diff)
downloadmitmproxy-09edbd9492e59c0c8dcae69b4b1f4b745867abe4.tar.gz
mitmproxy-09edbd9492e59c0c8dcae69b4b1f4b745867abe4.tar.bz2
mitmproxy-09edbd9492e59c0c8dcae69b4b1f4b745867abe4.zip
Improve debugging of thread and other leaks
- Add basethread.BaseThread that all threads outside of test suites should use - Add a signal handler to mitmproxy, mitmdump and mitmweb that dumps resource information to screen when SIGUSR1 is received. - Improve thread naming throughout to make thread dumps understandable
Diffstat (limited to 'pathod/test.py')
-rw-r--r--pathod/test.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pathod/test.py b/pathod/test.py
index 11462729..3ba541b1 100644
--- a/pathod/test.py
+++ b/pathod/test.py
@@ -1,10 +1,10 @@
from six.moves import cStringIO as StringIO
-import threading
import time
from six.moves import queue
from . import pathod
+from netlib import basethread
class TimeoutError(Exception):
@@ -95,11 +95,10 @@ class Daemon:
self.thread.join()
-class _PaThread(threading.Thread):
+class _PaThread(basethread.BaseThread):
def __init__(self, iface, q, ssl, daemonargs):
- threading.Thread.__init__(self)
- self.name = "PathodThread"
+ basethread.BaseThread.__init__(self, "PathodThread")
self.iface, self.q, self.ssl = iface, q, ssl
self.daemonargs = daemonargs
self.server = None