mirror of
https://github.com/coder/coder.git
synced 2026-06-04 13:38:21 +00:00
c389c2bc5c
TestInterruptAutoPromotionIgnoresLaterUsageLimitIncrease still relied on wall-clock polling after the acquire loop moved to a mock clock, so it could assert before chatd finished its asynchronous cleanup and auto-promotion work. Wait on explicit request-start signals and on the server's in-flight chat work before asserting the intermediate and final database state. This keeps the test synchronized with the actual processor lifecycle instead of scheduler timing. Closes https://github.com/coder/internal/issues/1406
10 lines
382 B
Go
10 lines
382 B
Go
package chatd
|
|
|
|
// WaitUntilIdleForTest waits for background chat work tracked by the server to
|
|
// finish without shutting the server down. Tests use this to assert final
|
|
// database state only after asynchronous chat processing has completed.
|
|
// Close waits for the same tracked work, but also stops the server.
|
|
func WaitUntilIdleForTest(server *Server) {
|
|
server.inflight.Wait()
|
|
}
|