math/rand/v2

This commit is contained in:
chrislu committed 2025-08-27 13:45:31 -07:00
1 parent 5b34eea26c
commit 102a081dd9
15 files changed
+42 -37

No files matched your search

+1 -1
View File
@@ -91,7 +91,7 @@ func waitForS3Service(t *testing.T, client *s3.Client, timeout time.Duration) {
func getNewBucketName() string {
timestamp := time.Now().UnixNano()
// Add random suffix to prevent collisions when tests run quickly
randomSuffix := mathrand.Intn(100000)
randomSuffix := mathrand.IntN(100000)
return fmt.Sprintf("%s%d-%d", defaultConfig.BucketPrefix, timestamp, randomSuffix)
}
+1 -1
View File
@@ -656,7 +656,7 @@ func (f *S3IAMTestFramework) GenerateUniqueBucketName(prefix string) string {
testName = strings.ReplaceAll(testName, "_", "-")
// Add random suffix to handle parallel tests
randomSuffix := mathrand.Intn(10000)
randomSuffix := mathrand.IntN(10000)
return fmt.Sprintf("%s-%s-%d", prefix, testName, randomSuffix)
}