Skip to content

Commit

Permalink
WIP: CI 12
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Dec 27, 2023
1 parent 5889678 commit 04de8fd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

</tbody>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
15 changes: 11 additions & 4 deletions tests/test_e2e_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=-",
Expand Down Expand Up @@ -156,15 +157,15 @@ 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]


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()

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 04de8fd

Please sign in to comment.