Commit 44a27125 authored by Pierre de La Morinerie's avatar Pierre de La Morinerie Committed by Chris

Wait for goroutines to finish before shuting down server (#8259)

When running server tests, the server will exit while some jobs spawned
through a goroutine are still running. This may crash the test harness,
as the jobs try to access a shut down app instance.

Fortunately the fix is easy: we just have to use the same App
goroutine-counting facility than the rest of the method's goroutines.
parent cafa4e43
......@@ -130,11 +130,21 @@ func runServer(configFileLocation string, disableConfigWatch bool, interruptChan
go runSecurityJob(a)
go runDiagnosticsJob(a)
go runSessionCleanupJob(a)
go runTokenCleanupJob(a)
go runCommandWebhookCleanupJob(a)
a.Go(func() {
a.Go(func() {
a.Go(func() {
a.Go(func() {
a.Go(func() {
if complianceI := a.Compliance; complianceI != nil {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment