Skip to content

test: unblock docker fixtures on macOS hosts#3622

Merged
benoitc merged 2 commits into
masterfrom
test/docker-port-and-ipv4-fixes
May 4, 2026
Merged

test: unblock docker fixtures on macOS hosts#3622
benoitc merged 2 commits into
masterfrom
test/docker-port-and-ipv4-fixes

Conversation

@benoitc

@benoitc benoitc commented May 4, 2026

Copy link
Copy Markdown
Owner

Three docker-fixture changes to make the suites runnable on a macOS host:

  • `per_app_allocation`: move the host port from 8001 to 28001. OrbStack reserves 8001 for its `vcom-tunnel` service, so any docker-run binding 8001 fails immediately.
  • `dirty_ttin_ttou`: pin `BASE_URL` to `http://127.0.0.1:18000\` instead of `http://localhost:18000\`. `localhost` resolves to `::1` first; Docker Desktop / OrbStack forward host ports on IPv4 only, so the IPv6 attempt resets and the fixture flags the service unhealthy.
  • `dirty_ttin_ttou`: install `setproctitle` in the docker image. The TTIN/TTOU tests count workers via `pgrep -f dirty-worker`, which only matches after `gunicorn.util._setproctitle` renames the processes. Without the package the rename is a no-op and the count is always 0.

Linux CI runners aren't affected by either of the macOS port issues, but pinning IPv4 and adding the dependency makes the fixtures portable.

benoitc added 2 commits May 4, 2026 09:47
- per_app_allocation: move host port from 8001 to 28001. OrbStack reserves
  8001 on macOS for vcom-tunnel which makes 'Bind: port already allocated'
  the default failure mode.
- dirty_ttin_ttou: pin BASE_URL to 127.0.0.1 instead of 'localhost'. macOS
  resolves 'localhost' to ::1 first; Docker Desktop / OrbStack only forward
  host ports on IPv4 so the IPv6 attempt resets and the test fixture treats
  the service as unhealthy.
- dirty_ttin_ttou: add setproctitle to the test image. The TTIN/TTOU tests
  count workers via 'pgrep -f dirty-worker', which only matches once
  gunicorn's util._setproctitle has actually renamed the processes.
- /unlimited and /limited handlers passed the data dict where the dirty
  client expected the action (method) name, surfacing as a 500 from
  getattr(self, action) on the dirty worker. Pass 'process' as the
  action so the call routes to DirtyApp.process(data).
- TestUnlimitedApps now bumps worker count via TTIN and polls both apps
  for readiness before each test. The preceding TTOU-spam test pins the
  worker count at the LimitedTask floor (2) and the arbiter takes a
  moment to rebind apps to the surviving workers; the previous tests
  raced that rebind and saw 'No workers available'.
@benoitc benoitc merged commit 5a655af into master May 4, 2026
24 checks passed
@benoitc benoitc deleted the test/docker-port-and-ipv4-fixes branch May 4, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant