test: Check if provisionerd is closed before setting run chan (#1145)

This race can be seen here:
https://github.com/coder/coder/runs/6159662393?check_suite_focus=true
This commit is contained in:
Kyle Carberry
2022-04-25 12:00:54 -05:00
committed by GitHub
parent 8c27b4e23d
commit 66d45f391e
+3
View File
@@ -230,6 +230,9 @@ func (p *Server) acquireJob(ctx context.Context) {
if job.JobId == "" {
return
}
if p.isClosed() {
return
}
ctx, p.jobCancel = context.WithCancel(ctx)
p.jobRunning = make(chan struct{})
p.jobFailed.Store(false)