summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-04-14 03:02:16 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-04-14 03:02:16 +0100
commit3c58a4bfc11d2d73fc72d1dbaeda4494d00508b8 (patch)
tree76ae672bd7a2c3c7cf75ec69fa5a79ec0a64116b /test/test_python_application.py
parent0bfa09dfa0ec6a1474ba30d0e1f8aea832fbc1fc (diff)
downloadunit-3c58a4bfc11d2d73fc72d1dbaeda4494d00508b8.tar.gz
unit-3c58a4bfc11d2d73fc72d1dbaeda4494d00508b8.tar.bz2
Tests: added test with rescheduling requests.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r--test/test_python_application.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index 5741d2d8..8d435b48 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -382,6 +382,38 @@ Connection: close
self.wait_for_record(r'At exit called\.'), 'atexit'
)
+ def test_python_process_switch(self):
+ self.load('delayed')
+
+ self.assertIn(
+ 'success',
+ self.conf('2', 'applications/delayed/processes'),
+ 'configure 2 processes',
+ )
+
+ self.get(headers={
+ 'Host': 'localhost',
+ 'Content-Length': '0',
+ 'X-Delay': '5',
+ 'Connection': 'close',
+ }, no_recv=True)
+
+ headers_delay_1 = {
+ 'Connection': 'close',
+ 'Host': 'localhost',
+ 'Content-Length': '0',
+ 'X-Delay': '1',
+ }
+
+ self.get(headers=headers_delay_1, no_recv=True)
+
+ time.sleep(0.5)
+
+ for _ in range(10):
+ self.get(headers=headers_delay_1, no_recv=True)
+
+ self.get(headers=headers_delay_1)
+
@unittest.skip('not yet')
def test_python_application_start_response_exit(self):
self.load('start_response_exit')