mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 09:19:41 +08:00
fix: increase the randomness of parameterized data-driven random strategy
This commit is contained in:
@@ -163,7 +163,7 @@ func (iter *ParametersIterator) Next() map[string]interface{} {
|
||||
|
||||
// merge with random parameters
|
||||
for _, paramName := range iter.randomParameterNames {
|
||||
randSource := rand.New(rand.NewSource(time.Now().Unix()))
|
||||
randSource := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
randIndex := randSource.Intn(len(iter.data[paramName]))
|
||||
for k, v := range iter.data[paramName][randIndex] {
|
||||
selectedParameters[k] = v
|
||||
|
||||
Reference in New Issue
Block a user