diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9c174578c..0bb63f6a8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -41,6 +41,13 @@ jobs: container: image: lmsysorg/sglang:v0.5.18-cu130 # we lock to this version to avoid repeated docker pull options: --gpus all --shm-size=2g --rm -v /dev/shm --privileged --pid=host + # The self-hosted runner exports HTTP(S)_PROXY into the container but no + # longer a NO_PROXY, so local requests (sglang's own warmup to 127.0.0.1) + # went through the proxy and got 502. Keep loopback off the proxy here + # instead of relying on the runner's environment. (Actions env keys are + # case-insensitive, so no separate no_proxy; Python reads either case.) + env: + NO_PROXY: localhost,127.0.0.1,::1 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/tests/test_runtime/test_server_capture_gate.py b/tests/test_runtime/test_server_capture_gate.py index 08832183a..ff6cf51fe 100644 --- a/tests/test_runtime/test_server_capture_gate.py +++ b/tests/test_runtime/test_server_capture_gate.py @@ -76,6 +76,15 @@ def _mooncake_available() -> bool: return importlib.util.find_spec("mooncake.store") is not None +def _log_tail(path, lines=80): + """Last lines of a subprocess log, so CI shows why the process died.""" + try: + with open(path, errors="replace") as f: + return "".join(f.readlines()[-lines:]) + except OSError as exc: + return f"" + + @unittest.skipUnless( CUDA and ENABLED, "server-capture gate: set SPECFORGE_RUN_SERVER_CAPTURE_TESTS=1 (GPU)", @@ -183,7 +192,9 @@ def setUpClass(cls): break time.sleep(5) raise RuntimeError( - f"sglang server did not become healthy; see {cls.workdir}/server.log" + "sglang server did not become healthy " + f"(exit code {cls.server.poll()}); tail of {cls.workdir}/server.log:\n" + + _log_tail(os.path.join(cls.workdir, "server.log")) ) @classmethod