diff options
author | Andrei Belov <defan@nginx.com> | 2021-03-25 17:32:53 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2021-03-25 17:32:53 +0300 |
commit | 83d2ce0ae884f73a111f9b1807d5393a150bf116 (patch) | |
tree | 2c483a9eae55233df4e308c5232734e03622cee0 /test/unit | |
parent | d2579d52b9583e5add0a71c6c7fb9f1b0c948a59 (diff) | |
parent | 3c969905bd6db6446b5213acb616e8c04ff546f4 (diff) | |
download | unit-83d2ce0ae884f73a111f9b1807d5393a150bf116.tar.gz unit-83d2ce0ae884f73a111f9b1807d5393a150bf116.tar.bz2 |
Merged with the default branch.1.23.0-1
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/applications/lang/java.py | 2 | ||||
-rw-r--r-- | test/unit/applications/proto.py | 4 | ||||
-rw-r--r-- | test/unit/check/regex.py | 13 | ||||
-rw-r--r-- | test/unit/utils.py | 2 |
4 files changed, 17 insertions, 4 deletions
diff --git a/test/unit/applications/lang/java.py b/test/unit/applications/lang/java.py index b2e17f23..c9c2095e 100644 --- a/test/unit/applications/lang/java.py +++ b/test/unit/applications/lang/java.py @@ -52,7 +52,7 @@ class TestApplicationJava(TestApplicationProto): os.makedirs(classes_path) classpath = ( - option.current_dir + '/build/tomcat-servlet-api-9.0.39.jar' + option.current_dir + '/build/tomcat-servlet-api-9.0.44.jar' ) ws_jars = glob.glob( diff --git a/test/unit/applications/proto.py b/test/unit/applications/proto.py index af05d071..5c400621 100644 --- a/test/unit/applications/proto.py +++ b/test/unit/applications/proto.py @@ -19,8 +19,8 @@ class TestApplicationProto(TestControl): with open(option.temp_dir + '/' + name, 'r', errors='ignore') as f: return re.search(pattern, f.read()) - def wait_for_record(self, pattern, name='unit.log'): - for i in range(50): + def wait_for_record(self, pattern, name='unit.log', wait=150): + for i in range(wait): found = self.search_in_log(pattern, name) if found is not None: diff --git a/test/unit/check/regex.py b/test/unit/check/regex.py new file mode 100644 index 00000000..734c0150 --- /dev/null +++ b/test/unit/check/regex.py @@ -0,0 +1,13 @@ +import re +import subprocess + + +def check_regex(unitd): + output = subprocess.check_output( + [unitd, '--version'], stderr=subprocess.STDOUT + ) + + if re.search('--no-regex', output.decode()): + return False + + return True diff --git a/test/unit/utils.py b/test/unit/utils.py index 7a0a3fe5..e80fc469 100644 --- a/test/unit/utils.py +++ b/test/unit/utils.py @@ -47,7 +47,7 @@ def waitforsocket(port): except KeyboardInterrupt: raise - pytest.fail('Can\'t connect to the 127.0.0.1:' + port) + pytest.fail('Can\'t connect to the 127.0.0.1:' + str(port)) def findmnt(): |