#2836·DocsGPT

Bug Report: tests/deploy fail when the dev API is running on port 7091

Author: vijayarawatCreated Sep 27, 2026Updated Sep 27, 2026

Description

Running python -m pytest while the documented dev API is up (uvicorn docsgpt.asgi:asgi_app --port 7091) makes 40 tests in tests/deploy/test_native.py and tests/deploy/test_doctor.py fail with:

DeployError: port 7091 is already in use by something other than this install's API.

Tests that don't pass --port use stack.DEFAULT_PORT (7091), and commands._port_is_free() binds the real port on the test machine. Some tests fail with "Regex pattern did not match" instead, because the port error is raised before the error they expect.

Reproduction steps

  1. Start the API: uvicorn docsgpt.asgi:asgi_app --host 0.0.0.0 --port 7091
  2. Run: python -m pytest tests/deploy -q
  3. 40 failures. With the API stopped, all pass.

Expected behavior

The deploy tests should not depend on whether port 7091 is free on the developer's machine. The tests that exercise the busy-port refusal already hold their own ephemeral port, so only the default port needs isolating.

Actual Behavior with Screenshots

deploy fail when the dev API is running on port 709

Operating system

Linux

What browsers are you seeing the problem on?

No response

What development environment are you experiencing this bug on?

Docker

Did you set the correct environment variables in the right path? List the environment variable names (not values please!)

No response

Provide any additional context for the Bug.

No response

Relevant log output

bash

Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

‍⚖️ Code of Conduct

  • I agree to follow this project's Code of Conduct