diff --git a/cmd/root.go b/cmd/root.go index 9bfcdaf..772763b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -26,7 +26,7 @@ var rootCmd = &cobra.Command{ } if version { - log.Printf("Local build; Unknown version\n") + log.Print("Local build; Unknown version\n") return } diff --git a/pkg/coordinator/coordinator.go b/pkg/coordinator/coordinator.go index f7866be..ff4e581 100644 --- a/pkg/coordinator/coordinator.go +++ b/pkg/coordinator/coordinator.go @@ -46,7 +46,7 @@ type Coordinator struct { maxConcurrentTests int } -func NewCoordinator(config *Config, log logrus.FieldLogger, metricsPort int, maxConcurrentTests int) *Coordinator { +func NewCoordinator(config *Config, log logrus.FieldLogger, metricsPort, maxConcurrentTests int) *Coordinator { return &Coordinator{ log: logger.NewLogger(&logger.ScopeOptions{ Parent: log, @@ -283,14 +283,14 @@ func (c *Coordinator) runTestExecutionLoop(ctx context.Context) { c.testRegistryMutex.Unlock() if nextTest != nil { - // run next test - semaphore <- true - go func(nextTest types.Test) { + testFunc := func(nextTest types.Test) { defer func() { <-semaphore }() c.runTest(ctx, nextTest) - }(nextTest) + } + semaphore <- true + go testFunc(nextTest) } else { // sleep and wait for queue notification select {