Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion central/processindicator/pruner/pruner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func processToIDAndArgs(process *storage.ProcessIndicator) processindicator.IDAn
}

func TestRabbitMQPruning(t *testing.T) {
rand.Seed(time.Now().UnixNano())
var processes []processindicator.IDAndArgs
processes = append(processes, processToIDAndArgs(deterministicRabbitMQProcess))
for i := 0; i < 1000; i++ {
Expand Down
4 changes: 0 additions & 4 deletions compliance/compliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package compliance

import (
"context"
"math/rand"
"os"
"os/signal"
"syscall"
Expand Down Expand Up @@ -61,9 +60,6 @@ func (c *Compliance) Start() {
log.Infof("Running StackRox Version: %s", version.GetMainVersion())
clientconn.SetUserAgent(clientconn.Compliance)

// Set the random seed based on the current time.
rand.Seed(time.Now().UnixNano())

// Start the prometheus metrics server
metrics.NewServer(metrics.ComplianceSubsystem, metrics.NewTLSConfigurerFromEnv()).RunForever()
metrics.GatherThrottleMetricsForever(metrics.ComplianceSubsystem.String())
Expand Down
8 changes: 4 additions & 4 deletions migrator/clone/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ func doTestCloneMigrationFailureAndReentry(t *testing.T) {
},
}
// For the parameters that should not matter, run pseudo random to get coverage on different cases
rand.Seed(8181818)
r := rand.New(rand.NewSource(8181818))
for _, c := range testCases {
reboot := rand.Intn(2) == 1
reboot := r.Intn(2) == 1
if reboot {
c.description = c.description + " with reboot"
}
Expand Down Expand Up @@ -436,9 +436,9 @@ func doTestRollback(t *testing.T) {
breakPoint: breakAfterGetClone,
},
}
rand.Seed(8056)
r := rand.New(rand.NewSource(8056))
for _, c := range testCases {
reboot := rand.Intn(2) == 1
reboot := r.Intn(2) == 1
if reboot {
c.description = c.description + " with reboot"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"math/rand"
"testing"
"time"

"github.com/stackrox/rox/generated/storage"
"github.com/stackrox/rox/sensor/common/selector"
Expand All @@ -26,11 +25,6 @@ type namespaceAndSelector struct {
selector selector.Selector
}

func init() {
rand.Seed(time.Now().UnixNano())

}

// BenchmarkBuildDeployments_NoChange uses one deployment and generates
// 10k updates without meaningful change. This is to test that
// we don't do useless clones if the object is the same.
Expand Down
3 changes: 0 additions & 3 deletions sensor/tests/pipeline/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"math/rand"
"net"
"testing"
"time"

"github.com/stackrox/rox/generated/internalapi/central"
"github.com/stackrox/rox/generated/storage"
Expand Down Expand Up @@ -40,8 +39,6 @@ var (
)

func init() {
rand.Seed(time.Now().UnixNano())

serviceAccounts = make([]string, 1000)
for i := 0; i < 1000; i++ {
serviceAccounts[i] = randString(5)
Expand Down
Loading