mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
78131699c4
The FakeIDP mux.NotFound handler called t.Errorf for any unrecognized HTTP request, failing the owning test. It also never wrote an HTTP response, so the stale caller got a 200 with an empty body, hiding the problem on the caller side. When the IDP runs as a real HTTP server (WithServing), OS port reuse across concurrent test binaries can route stale connections to the IDP port. The source is enterprise provisionerd reconnects and DERP clients from parallel tests whose coderd servers have shut down. Check whether the NotFound request path starts with a known IDP route prefix (/oauth2/, /.well-known/, /login/, /external-auth-validate/). IDP paths: t.Errorf, logger.Error, and 404 response. Non-IDP paths: t.Logf, logger.Warn, and 421 Misdirected Request response. Both branches now return a proper HTTP error so the offending caller can be traced.