Skip to content

Commit

Permalink
Seed a local rand
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Feb 21, 2023
1 parent 6bdd766 commit 710a1e1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions integration/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ func genEntries(params TestParameters) []*trillian.LogLeaf {
// Shuffle the leaves to see if that breaks things, but record the rand seed
// so we can reproduce failures.
seed := time.Now().UnixNano()
rand.Seed(seed)
perm := rand.Perm(int(params.LeafCount))
perm := rand.New(rand.NewSource(seed)).Perm(int(params.LeafCount))
klog.Infof("Generating %d leaves, %d unique, using permutation seed %d", params.LeafCount, params.UniqueLeaves, seed)

leaves := make([]*trillian.LogLeaf, 0, params.LeafCount)
Expand Down

0 comments on commit 710a1e1

Please sign in to comment.