fix: keep load test websocket sessions alive
This commit is contained in:
@@ -141,6 +141,9 @@ func runAgent(ctx context.Context, cfg *Config, manifest *Manifest, machine, coo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if alive := run.aliveConnections(); alive != len(run.clients) {
|
||||
return fmt.Errorf("connections alive after coordinator wait=%d expected=%d", alive, len(run.clients))
|
||||
}
|
||||
if !runIDPattern.MatchString(start.RunID) || !validScenario(start.Scenario) {
|
||||
return fmt.Errorf("invalid coordinator start: %+v", start)
|
||||
}
|
||||
@@ -586,6 +589,16 @@ func (r *agentRun) acceptedCopy() []AcceptedMessage {
|
||||
return out
|
||||
}
|
||||
|
||||
func (r *agentRun) aliveConnections() int {
|
||||
alive := 0
|
||||
for _, client := range r.clients {
|
||||
if client.alive() {
|
||||
alive++
|
||||
}
|
||||
}
|
||||
return alive
|
||||
}
|
||||
|
||||
func (r *agentRun) drainDuration() (time.Duration, error) {
|
||||
if r.scenario == "p2p" {
|
||||
return configDuration(r.cfg.DrainP2P)
|
||||
|
||||
Reference in New Issue
Block a user