Skip to content

Commit a109f2f

Browse files
committed
test: Check if provisionerd is closed before setting run chan
This race can be seen here: https://github.com/coder/coder/runs/6159662393?check_suite_focus=true
1 parent 5575e3c commit a109f2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

provisionerd/provisionerd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ func (p *Server) acquireJob(ctx context.Context) {
230230
if job.JobId == "" {
231231
return
232232
}
233+
if p.isClosed() {
234+
return
235+
}
233236
ctx, p.jobCancel = context.WithCancel(ctx)
234237
p.jobRunning = make(chan struct{})
235238
p.jobFailed.Store(false)

0 commit comments

Comments
 (0)