mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-21 04:22:30 +08:00
fix: unittest
This commit is contained in:
@@ -392,7 +392,7 @@ var (
|
||||
gaugeState = prometheus.NewGauge(
|
||||
prometheus.GaugeOpts{
|
||||
Name: "state",
|
||||
Help: "The current runner state, 1=initializing, 2=spawning, 3=running, 4=quitting, 5=stopped",
|
||||
Help: "The current runner state, 1=initializing, 2=spawning, 3=running, 4=stopping, 5=stopped, 6=quitting, 7=missing",
|
||||
},
|
||||
)
|
||||
gaugeDuration = prometheus.NewGauge(
|
||||
|
||||
@@ -43,7 +43,7 @@ func getStateName(state int32) (stateName string) {
|
||||
case StateQuitting:
|
||||
stateName = "quitting"
|
||||
case StateMissing:
|
||||
stateName = "stopped"
|
||||
stateName = "missing"
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -840,9 +840,12 @@ func (r *workerRunner) run() {
|
||||
log.Warn().Msg("Timeout waiting for sending quit message to master, boomer will quit any way.")
|
||||
}
|
||||
|
||||
if err = r.client.signOut(r.client.config.ctx); err != nil {
|
||||
log.Error().Err(err).Msg("failed to sign out")
|
||||
if r.getState() != StateMissing {
|
||||
if err = r.client.signOut(r.client.config.ctx); err != nil {
|
||||
log.Error().Err(err).Msg("failed to sign out")
|
||||
}
|
||||
}
|
||||
|
||||
r.client.close()
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -196,7 +196,7 @@ func TestSpawnWorkersWithManyTasks(t *testing.T) {
|
||||
const numToSpawn int64 = 30
|
||||
|
||||
go runner.spawnWorkers(numToSpawn, float64(numToSpawn), runner.stopChan, runner.spawnComplete)
|
||||
time.Sleep(2 * time.Second)
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
currentClients := runner.controller.getCurrentClientsNum()
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package boomer
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package boomer
|
||||
|
||||
Reference in New Issue
Block a user