From fb1b9113a101e2b5bf174140f95f06131f23e91f Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 4 Jun 2015 19:55:01 +1200 Subject: [PATCH] Try to fix test suite race like a savage. --- test/test_pathoc.py | 8 +++++--- test/test_pathod.py | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/test_pathoc.py b/test/test_pathoc.py index 05519e4d4..994975fce 100644 --- a/test/test_pathoc.py +++ b/test/test_pathoc.py @@ -147,14 +147,16 @@ class TestDaemon(_TestDaemon): def test_timeout(self): assert "Timeout" in self.tval(["get:'/p/200:p0,10'"], timeout=0.01) assert "HTTP" in self.tval( - ["get:'/p/200:p5,10'"], + ["get:'/p/200:p5,100'"], showresp=True, - timeout=0.01) + timeout=0.01 + ) assert not "HTTP" in self.tval( ["get:'/p/200:p3,10'"], showresp=True, timeout=0.01, - ignoretimeout=True) + ignoretimeout=True + ) def test_showresp(self): reqs = ["get:/api/info:p0,0", "get:/api/info:p0,0"] diff --git a/test/test_pathod.py b/test/test_pathod.py index 613cb1f5e..2adcae401 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -1,6 +1,8 @@ import cStringIO from libpathod import pathod, version from netlib import tcp, http +import time + import tutils @@ -200,7 +202,8 @@ class CommonTests(tutils.DaemonTests): def test_websocket_frame(self): r = self.pathoc(["ws:/p/", "wf:b@10"], ws_read_limit=0) - assert "wsframe" in [i["type"] for i in self.d.log()] + time.sleep(0.01) + assert self.d.last_log()["type"] == "wsframe" class TestDaemon(CommonTests):