fix: unittest

This commit is contained in:
徐聪
2022-07-14 15:24:43 +08:00
parent 683c0e5374
commit 8fa04335e9
2 changed files with 1 additions and 2 deletions

View File

@@ -383,7 +383,6 @@ func (r *runner) spawnWorkers(spawnCount int64, spawnRate float64, quit chan boo
// spawn workers with rate limit
sleepTime := time.Duration(1000000/r.controller.getSpawnRate()) * time.Microsecond
time.Sleep(sleepTime)
// loop count per worker
var workerLoop *Loop
if r.loop != nil {

View File

@@ -193,7 +193,7 @@ func TestSpawnWorkersWithManyTasks(t *testing.T) {
runner.setTasks(tasks)
runner.client = newClient("localhost", 5557, runner.nodeID)
const numToSpawn int64 = 30
const numToSpawn int64 = 20
go runner.spawnWorkers(numToSpawn, float64(numToSpawn), runner.stopChan, runner.spawnComplete)
time.Sleep(3 * time.Second)