func startApi() *runner.TestRunner { startChan := &runner.StartChannels{RunnerChan: make(chan *runner.TestRunner), ErrorChan: make(chan error), KillChan: make(chan bool)} go api.StartAPIService(0, startChan) select { case runner := <-startChan.RunnerChan: return runner case err := <-startChan.ErrorChan: logger.Fatal("Failed to start gauge API: %s", err.Error()) } return nil }
func startApi() *runner.TestRunner { startChan := &runner.StartChannels{RunnerChan: make(chan *runner.TestRunner), ErrorChan: make(chan error), KillChan: make(chan bool)} go api.StartAPIService(0, startChan) select { case runner := <-startChan.RunnerChan: return runner case err := <-startChan.ErrorChan: execLogger.CriticalError(errors.New(fmt.Sprintf("Failed to start gauge API. %s\n", err.Error()))) } return nil }