Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Jung <jungjust@amazon.com>
  • Loading branch information
justinjung04 committed Jul 10, 2024
1 parent 416c08e commit b7dd40a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/scheduler/queue/user_queues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ func TestGetOrAddQueueShouldUpdateProperties(t *testing.T) {
}

func TestGetOrAddQueueConcurrency(t *testing.T) {
const numGoRoutines = 100
const numGoRoutines = 10
limits := MockLimits{
MaxOutstanding: 3,
MaxOutstanding: 50,
}
q := newUserQueues(0, 0, limits, nil)
q.addQuerierConnection("q-1")
Expand All @@ -474,14 +474,12 @@ func TestGetOrAddQueueConcurrency(t *testing.T) {
wg.Add(numGoRoutines)

for i := 0; i < numGoRoutines; i++ {
go func(maxOutstanding int) {
go func(cnt int) {
defer wg.Done()
limits.MaxOutstanding = maxOutstanding + 50
q.limits = limits
queue := q.getOrAddQueue("userID", 2)
if rand.Int()%2 == 0 {
if cnt%2 == 0 {
queue.enqueueRequest(MockRequest{})
} else if rand.Int()%9 == 0 {
} else if cnt%5 == 0 {
queue.dequeueRequest(0, false)
}
}(i)
Expand Down

0 comments on commit b7dd40a

Please sign in to comment.