diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/proxy/protocol/test_http2.py | 7 | ||||
-rw-r--r-- | test/mitmproxy/tservers.py | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/mitmproxy/proxy/protocol/test_http2.py b/test/mitmproxy/proxy/protocol/test_http2.py index 8b929995..1cc36402 100644 --- a/test/mitmproxy/proxy/protocol/test_http2.py +++ b/test/mitmproxy/proxy/protocol/test_http2.py @@ -6,11 +6,11 @@ import tempfile import traceback import pytest import h2 +import time from mitmproxy import options import mitmproxy.net -from mitmproxy.addons import core from ...net import tservers as net_tservers from mitmproxy import exceptions from mitmproxy.net.http import http1, http2 @@ -92,6 +92,10 @@ class _Http2TestBase: cls.options = cls.get_options() cls.proxy = tservers.ProxyThread(tservers.TestMaster, cls.options) cls.proxy.start() + while True: + if cls.proxy.tmaster: + break + time.sleep(0.01) @classmethod def teardown_class(cls): @@ -118,6 +122,7 @@ class _Http2TestBase: def teardown(self): if self.client: self.client.close() + self.server.server.wait_for_silence() def setup_connection(self): self.client = mitmproxy.net.tcp.TCPClient(("127.0.0.1", self.proxy.port)) diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py index 18e4f27d..d72ca138 100644 --- a/test/mitmproxy/tservers.py +++ b/test/mitmproxy/tservers.py @@ -122,7 +122,6 @@ class ProxyThread(threading.Thread): self.tmaster.addons.trigger("tick") - class ProxyTestBase: # Test Configuration ssl = None |