chore: add test for coord rolling restart (#14680)

Closes https://github.com/coder/team-coconut/issues/50

---------

Co-authored-by: Ethan Dickson <ethan@coder.com>
This commit is contained in:
Dean Sheather
2024-11-20 17:04:33 +10:00
committed by GitHub
parent 9e63caf593
commit fbe2fa66f5
4 changed files with 348 additions and 6 deletions

View File

@ -1485,9 +1485,6 @@ func (api *API) Close() error {
default:
api.cancel()
}
if api.derpCloseFunc != nil {
api.derpCloseFunc()
}
wsDone := make(chan struct{})
timer := time.NewTimer(10 * time.Second)
@ -1513,11 +1510,16 @@ func (api *API) Close() error {
api.updateChecker.Close()
}
_ = api.workspaceAppServer.Close()
_ = api.agentProvider.Close()
if api.derpCloseFunc != nil {
api.derpCloseFunc()
}
// The coordinator should be closed after the agent provider, and the DERP
// handler.
coordinator := api.TailnetCoordinator.Load()
if coordinator != nil {
_ = (*coordinator).Close()
}
_ = api.agentProvider.Close()
_ = api.statsReporter.Close()
_ = api.NetworkTelemetryBatcher.Close()
_ = api.OIDCConvertKeyCache.Close()