Skip to content

Commit

Permalink
Fix race in ramping arrival rate
Browse files Browse the repository at this point in the history
originally discussed in this comment
grafana/k6#1957 (comment)
  • Loading branch information
mstoykov committed May 21, 2021
1 parent 9ed27f8 commit a3cb336
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/executor/ramping_arrival_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@ func (varr RampingArrivalRate) Run(parentCtx context.Context, out chan<- stats.S
vusPool := newActiveVUPool()

defer func() ***REMOVED***
vusPool.Close()
// Make sure all VUs aren't executing iterations anymore, for the cancel()
// below to deactivate them.
<-returnedVUs
// first close the vusPool so we wait for the gracefulShutdown
vusPool.Close()
cancel()
activeVUsWg.Wait()
***REMOVED***()
Expand Down

0 comments on commit a3cb336

Please sign in to comment.