aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-11-14 22:14:18 +0100
committerMaximilian Hils <git@maximilianhils.com>2015-11-14 22:14:18 +0100
commit57cd9022d9253c7873ff3bd1d7943296bdf90268 (patch)
treeebbd1901b0fd5e3964fe7f3b70e13c55de9c1694
parentd6bd1cb4a697f40b1143457fe08eaca309dd4478 (diff)
downloadmitmproxy-57cd9022d9253c7873ff3bd1d7943296bdf90268.tar.gz
mitmproxy-57cd9022d9253c7873ff3bd1d7943296bdf90268.tar.bz2
mitmproxy-57cd9022d9253c7873ff3bd1d7943296bdf90268.zip
fix appveyor race conditions in tests
-rw-r--r--test/test_server.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/test_server.py b/test/test_server.py
index 0bf8b9c7..83b6423a 100644
--- a/test/test_server.py
+++ b/test/test_server.py
@@ -516,9 +516,8 @@ class TestProxy(tservers.HTTPProxTest):
assert f.status_code == 304
response = self.master.state.view[0].response
- # time.sleep might be a little bit shorter than a second,
- # we observed up to 0.93s on appveyor.
- assert 0.8 <= response.timestamp_end - response.timestamp_start
+ # timestamp_start might fire a bit late, so we play safe and only require 300ms.
+ assert 0.3 <= response.timestamp_end - response.timestamp_start
def test_request_timestamps(self):
# test that we notice a delay between timestamps in request object
@@ -537,9 +536,8 @@ class TestProxy(tservers.HTTPProxTest):
request, response = self.master.state.view[
0].request, self.master.state.view[0].response
assert response.status_code == 304 # sanity test for our low level request
- # time.sleep might be a little bit shorter than a second,
- # we observed up to 0.93s on appveyor.
- assert 0.8 < (request.timestamp_end - request.timestamp_start)
+ # timestamp_start might fire a bit late, so we play safe and only require 300ms.
+ assert 0.3 < (request.timestamp_end - request.timestamp_start)
def test_request_tcp_setup_timestamp_presence(self):
# tests that the client_conn a tcp connection has a tcp_setup_timestamp