diff --git a/.github/appveyor.yml b/.github/appveyor.yml index 77a88ae61..7a631fd32 100644 --- a/.github/appveyor.yml +++ b/.github/appveyor.yml @@ -3,7 +3,8 @@ image: Visual Studio 2022 branches: except: - gh-pages -clone_depth: 1 +# clone_depth: 1 produces odd "fatal: reference is not a tree" if pushing during checkout +clone_depth: 5 environment: matrix: - TOXENV: lint diff --git a/README.md b/README.md index 7cbf63203..70e495637 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ details. ### Notable changes tested in this repository * request smuggling vulnerabilities: [PR #3059](https://github.com/benoitc/gunicorn/pull/3059) [PR #3113](https://github.com/benoitc/gunicorn/pull/3113) - * configuration mismatch for SCRIPT_NAME: [PR #2804](https://github.com/benoitc/gunicorn/pull/2804) - * [Building a debian/ubuntu](.github/workflows/ubuntu.yml) package without pulling updated dependencies + * configuration mismatch for `SCRIPT_NAME`: [PR #2804](https://github.com/benoitc/gunicorn/pull/2804) + * [Building a debian/ubuntu](.github/workflows/packaging.yml) package without pulling updated dependencies * Ubuntu 22.04 may be willing to stick to setuptools 59 until **April 2032** diff --git a/tests/test_e2e.py b/tests/test_e2e.py index af737801f..5031e1553 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -187,7 +187,7 @@ class Client: def run(self): import http.client - conn = http.client.HTTPConnection(SERVER_BIND, timeout=1) + conn = http.client.HTTPConnection(SERVER_BIND, timeout=2) conn.request("GET", "/", headers={"Host": "localhost"}, body="GETBODY!") return conn.getresponse() diff --git a/tests/test_e2e_debug.py b/tests/test_e2e_debug.py index 13eadab2d..eddc9876d 100644 --- a/tests/test_e2e_debug.py +++ b/tests/test_e2e_debug.py @@ -25,6 +25,7 @@ GRACEFUL_TIMEOUT = 2 +WORKER_COUNT = 3 SERVER_PORT = 2048 + secrets.randbelow(1024 * 14) # FIXME: should also test inherited socket SERVER_BIND = "[::1]:%d" % SERVER_PORT @@ -102,7 +103,7 @@ def run(self): "gunicorn", "--config=%s" % os.devnull, "--log-level=debug", - "--workers=3", + "--workers=%d" % WORKER_COUNT, "--worker-class=sync", # "--enable-stdio-inheritance", # "--access-logfile=-", @@ -156,7 +157,7 @@ def _read_stdio(self, *, key, timeout_sec, wait_for_keyword): time.sleep(0.1) other = abs(key - 1) # assert buf[other] == "" - assert wait_for_keyword in buf[key] + assert wait_for_keyword in buf[key], buf[key] return buf[key] @@ -164,7 +165,7 @@ class Client: def run(self): import http.client - conn = http.client.HTTPConnection(SERVER_BIND, timeout=1) + conn = http.client.HTTPConnection(SERVER_BIND, timeout=2) conn.request("GET", "/", headers={"Host": "localhost"}, body="GETBODY!") return conn.getresponse() @@ -199,9 +200,15 @@ def test_process_shutdown_cleanly_after_inserting_syntax_error(): server.write_bad() # os.utime(editable_file) + # this test can fail flaky, when the keyword is not last line logged + # .. but the worker count is only logged when changed reload_log = server._read_stdio( - key=ERR, wait_for_keyword="reloading", timeout_sec=5 + key=ERR, + wait_for_keyword="SyntaxError: ", + # wait_for_keyword="%d workers" % WORKER_COUNT, + timeout_sec=6, ) + assert "reloading" in reload_log, reload_log assert ("%s.py modified" % APP_BASENAME) in reload_log assert "SyntaxError: invalid syntax" in reload_log, reload_log assert ('%s.py", line 3' % APP_BASENAME) in reload_log