Skip to content

Commit

Permalink
pkg/pillar: reduce test memory usage
Browse files Browse the repository at this point in the history
apparently rand.Seed needs a bit of memory, so better
not to call it all the time

Signed-off-by: Christoph Ostarek <[email protected]>
  • Loading branch information
christoph-zededa authored and OhmSpectator committed Oct 9, 2024
1 parent 2e52abc commit 4357ccb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/pillar/agentlog/agentlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ func increaseTotalRandomly(total int64) int64 {

func generateRandomAvgValue() float64 {
// Avg is a float of format 0.00 in range [0.00, 100.00]
seed := time.Now().UnixNano()
r := rand.New(rand.NewSource(seed))
return r.Float64() * 100
return rand.Float64() * 100
}

func matchPsiStats(line string) bool {
Expand Down

0 comments on commit 4357ccb

Please sign in to comment.