summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2019-11-13 16:51:12 +0300
committerAndrei Zeliankou <zelenkov@nginx.com>2019-11-13 16:51:12 +0300
commit45d75ee2cb33d38f64ca2ac5d871fa0cc2f1bcde (patch)
treeb0ae2d76af9714bbd81c887c492f561ad2d7ce3e /test/test_python_application.py
parent69ff7ce7315cc22db3196fef184e0dfad4de7218 (diff)
downloadunit-45d75ee2cb33d38f64ca2ac5d871fa0cc2f1bcde.tar.gz
unit-45d75ee2cb33d38f64ca2ac5d871fa0cc2f1bcde.tar.bz2
Tests: added Python test with threading.
Diffstat (limited to 'test/test_python_application.py')
-rw-r--r--test/test_python_application.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index 8632621c..ec59c741 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -507,6 +507,19 @@ Connection: close
self.assertEqual(self.get()['body'], '0123456789', 'write')
+ def test_python_application_threading(self):
+ """wait_for_record() timeouts after 5s while every thread works at
+ least 3s. So without releasing GIL test should fail.
+ """
+
+ self.load('threading')
+
+ for _ in range(10):
+ self.get(no_recv=True)
+
+ self.assertIsNotNone(
+ self.wait_for_record(r'\(5\) Thread: 100'), 'last thread finished'
+ )
if __name__ == '__main__':
TestPythonApplication.main()