Skip to content

Commit

Permalink
[Disk Manager] fix TestTasksRunningLimit test (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
BarkovBG authored Oct 16, 2024
1 parent 0c2aa2a commit fcae5e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cloud/tasks/tasks_tests/tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func TestTasksRunningLimit(t *testing.T) {
require.NoError(t, err)

tasksIds := []string{}
scheduledLongTaskCount := 3 * inflightLongTaskPerNodeLimit
scheduledLongTaskCount := 6 * inflightLongTaskPerNodeLimit
for i := 0; i < scheduledLongTaskCount; i++ {
reqCtx := getRequestContext(t, ctx)
id, err := scheduleLongTask(reqCtx, s.scheduler)
Expand Down Expand Up @@ -752,7 +752,12 @@ func TestTasksRunningLimit(t *testing.T) {
runningLongTaskCount++
}
}
require.LessOrEqual(t, runningLongTaskCount, inflightLongTaskPerNodeLimit)

// We have separate inflight per node limit for each lister.
// So long tasks can be taken by listerReadyToRun or
// listerStallingWhileRunning lister.
// Thus we need to compare runningLongTaskCount with doubled inflightLongTaskPerNodeLimit.
require.LessOrEqual(t, runningLongTaskCount, 2*inflightLongTaskPerNodeLimit)
case err := <-errs:
require.NoError(t, err)
endedLongTaskCount++
Expand Down

0 comments on commit fcae5e1

Please sign in to comment.