Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 committed Jul 17, 2024
1 parent dd1200d commit d2ac883
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions parallel/bounded_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package parallel
import (
"crypto/rand"
"fmt"
"math/big"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -199,7 +200,11 @@ func produceTasks(runner *runner, results chan int, errorsQueue *ErrorsQueue, ta
func createSuccessfulFlowTaskFunc(num int, result chan int) TaskFunc {
return func(threadId int) error {
result <- num
time.Sleep(time.Millisecond * time.Duration(rand.Intn(50)))
n, err := rand.Int(rand.Reader, big.NewInt(50))
if err != nil {
return err
}
time.Sleep(time.Millisecond * time.Duration(n.Int64()))
return nil
}
}
Expand All @@ -210,7 +215,11 @@ func createTaskWithErrorFunc(num int, result chan int) TaskFunc {
return fmt.Errorf("num: %d, above 50 going to stop", num)
}
result <- num
time.Sleep(time.Millisecond * time.Duration(rand.Intn(50)))
n, err := rand.Int(rand.Reader, big.NewInt(50))
if err != nil {
return err
}
time.Sleep(time.Millisecond * time.Duration(n.Int64()))
return nil
}
}
Expand All @@ -221,7 +230,11 @@ func createTaskWithIntAsErrorFunc(num int, result chan int) TaskFunc {
return fmt.Errorf("%d", num)
}
result <- num
time.Sleep(time.Millisecond * time.Duration(rand.Intn(50)))
n, err := rand.Int(rand.Reader, big.NewInt(50))
if err != nil {
return err
}
time.Sleep(time.Millisecond * time.Duration(n.Int64()))
return nil
}
}
Expand Down

0 comments on commit d2ac883

Please sign in to comment.