diff --git a/internal/weldr/api_test.go b/internal/weldr/api_test.go index 84d6c6f49..33b7d1209 100644 --- a/internal/weldr/api_test.go +++ b/internal/weldr/api_test.go @@ -774,9 +774,10 @@ func TestBlueprintsDelete(t *testing.T) { func TestBlueprintsChanges(t *testing.T) { api, sf := createTestWeldrAPI(t.TempDir(), test_distro.TestDistro1Name, test_distro.TestArchName, rpmmd_mock.BaseFixture, nil) t.Cleanup(sf.Cleanup) - rand.Seed(time.Now().UnixNano()) // math/rand is good enough in this case /* #nosec G404 */ + rand.New(rand.NewSource(time.Now().UnixNano())) + /* #nosec G404 */ id := strconv.Itoa(rand.Int()) ignoreFields := []string{"commit", "timestamp"} @@ -800,9 +801,10 @@ func TestBlueprintsChanges(t *testing.T) { func TestBlueprintChange(t *testing.T) { api, sf := createTestWeldrAPI(t.TempDir(), test_distro.TestDistro1Name, test_distro.TestArchName, rpmmd_mock.BaseFixture, nil) t.Cleanup(sf.Cleanup) - rand.Seed(time.Now().UnixNano()) // math/rand is good enough in this case /* #nosec G404 */ + rand.New(rand.NewSource(time.Now().UnixNano())) + /* #nosec G404 */ id := strconv.Itoa(rand.Int()) test.SendHTTP(api, true, "POST", "/api/v0/blueprints/new", `{"name":"`+id+`","description":"Test","packages":[{"name":"httpd","version":"2.4.*"}],"version":"0.0.1"}`) @@ -860,9 +862,10 @@ func TestBlueprintsDepsolve(t *testing.T) { func TestOldBlueprintsUndo(t *testing.T) { api, sf := createTestWeldrAPI(t.TempDir(), test_distro.TestDistro1Name, test_distro.TestArchName, rpmmd_mock.OldChangesFixture, nil) t.Cleanup(sf.Cleanup) - rand.Seed(time.Now().UnixNano()) // math/rand is good enough in this case /* #nosec G404 */ + rand.New(rand.NewSource(time.Now().UnixNano())) + /* #nosec G404 */ ignoreFields := []string{"commit", "timestamp"} test.TestRoute(t, api, true, "GET", "/api/v0/blueprints/changes/test-old-changes", ``, http.StatusOK, oldBlueprintsUndoResponse, ignoreFields...) @@ -895,9 +898,10 @@ func TestOldBlueprintsUndo(t *testing.T) { func TestNewBlueprintsUndo(t *testing.T) { api, sf := createTestWeldrAPI(t.TempDir(), test_distro.TestDistro1Name, test_distro.TestArchName, rpmmd_mock.BaseFixture, nil) t.Cleanup(sf.Cleanup) - rand.Seed(time.Now().UnixNano()) // math/rand is good enough in this case /* #nosec G404 */ + rand.New(rand.NewSource(time.Now().UnixNano())) + /* #nosec G404 */ id := strconv.Itoa(rand.Int()) ignoreFields := []string{"commit", "timestamp"}