mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
Under CI load the request's 10ms revoke timeout could expire before the request reached the FakeIDP revoke handler. The handler never ran, so the test's wait for it to finish blocked until the 25s test context expired instead of passing quickly. Raise `RevokeTimeout` to 100ms so the request has ~10x more headroom to reach the handler under load. After RevokeToken returns, check a `handlerStarted` signal before asserting: this anchors the `DeadlineExceeded` assertion to a request that was actually in flight, and turns any residual scheduling race into a fast, labeled failure instead of a hang. Unblock the handler on the early-exit path with a `t.Cleanup`. It must be registered after the FakeIDP setup so LIFO runs it before the server's `Close()`; otherwise a handler that dispatched late would block `Close()` and hang teardown until the test timeout. Drop the previous `time.Sleep` watchdog and the handler-done channel, since the FakeIDP server's `Close()` already joins the in-flight handler. Refs: https://linear.app/codercom/issue/PLAT-317