summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-04-23 15:26:46 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-04-23 15:26:46 +0300
commitb6226d6945dfb325fda04d15a95ae86e5cbd07ab (patch)
tree9b72eec027bb1dcbae577d0b3519554d0ec8c2ed /test
parentf264adeae9a37f851308d4d85c43831dee938d07 (diff)
downloadunit-b6226d6945dfb325fda04d15a95ae86e5cbd07ab.tar.gz
unit-b6226d6945dfb325fda04d15a95ae86e5cbd07ab.tar.bz2
Tests: added delay to wait for requests logging.
Diffstat (limited to 'test')
-rw-r--r--test/test_access_log.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_access_log.py b/test/test_access_log.py
index 8c7fae30..58497f47 100644
--- a/test/test_access_log.py
+++ b/test/test_access_log.py
@@ -1,5 +1,6 @@
import os
import re
+import time
from subprocess import call
import unittest
import unit
@@ -27,6 +28,8 @@ class TestUnitAccessLog(unit.TestUnitApplicationPython):
'Host': 'localhost'
}, start=True, body='01234')
+ time.sleep(0.2)
+
self.assertIsNotNone(
self.search_in_log(r'"POST / HTTP/1.1" 200 5'), 'keepalive 1')
@@ -36,6 +39,8 @@ class TestUnitAccessLog(unit.TestUnitApplicationPython):
'Host': 'localhost'
}, sock=sock, body='0123456789')
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -59,6 +64,8 @@ Connection: close
""", raw_resp=True, raw=True)
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -82,6 +89,8 @@ Connection: close
self.get(sock_type='ipv6')
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -97,6 +106,8 @@ Connection: close
'Connection': 'close'
})
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -112,6 +123,8 @@ Connection: close
'Connection': 'close'
})
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -123,6 +136,8 @@ Connection: close
self.get(http_10=True)
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -134,6 +149,8 @@ Connection: close
self.http(b"""GE""", raw_resp=True, raw=True)
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -144,6 +161,8 @@ Connection: close
self.http(b"""GET /\n""", raw_resp=True, raw=True)
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -154,6 +173,8 @@ Connection: close
self.http(b"""GET / HTTP/1.1""", raw_resp=True, raw=True)
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -164,6 +185,8 @@ Connection: close
resp = self.http(b"""GET / HTTP/1.1\n""", raw_resp=True, raw=True)
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -185,6 +208,8 @@ Connection: close
self.get(url='/?blah&var=val')
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -199,6 +224,8 @@ Connection: close
self.get(url='/delete')
+ time.sleep(0.2)
+
self.stop()
self.assertIsNone(self.search_in_log(r'/delete'), 'delete')
@@ -212,6 +239,8 @@ Connection: close
self.get()
+ time.sleep(0.2)
+
self.stop()
self.assertIsNotNone(
@@ -231,6 +260,8 @@ Connection: close
self.get()
+ time.sleep(0.2)
+
self.assertIsNotNone(
self.search_in_log(r'"GET / HTTP/1.1" 200 0 "-" "-"', 'new.log'),
'rename new')
@@ -245,6 +276,8 @@ Connection: close
self.get(url='/usr1')
+ time.sleep(0.2)
+
self.assertIsNone(
self.search_in_log(r'/usr1', 'new.log'), 'rename new 2')
self.assertIsNotNone(