feat: set peers lost when disconnected from coordinator (#11681)
Adds support to Coordination to call SetAllPeersLost() when it is closed. This ensure that when we disconnect from a Coordinator, we set all peers lost. This covers CoderSDK (CLI client) and Agent. Next PR will cover MultiAgent (notably, `wsproxy`).
This commit is contained in:
@@ -22,3 +22,13 @@ func RequireRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) (a A)
|
||||
return a
|
||||
}
|
||||
}
|
||||
|
||||
func RequireSendCtx[A any](ctx context.Context, t testing.TB, c chan<- A, a A) {
|
||||
t.Helper()
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
t.Fatal("timeout")
|
||||
case c <- a:
|
||||
// OK!
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user