From 3e0d5de7a3e3d55fb19d635feb0e6d8da5f6f7a2 Mon Sep 17 00:00:00 2001 From: Thomas J Faughnan Jr Date: Sun, 31 Mar 2024 01:43:10 -0400 Subject: [PATCH] api tests: use intSize-agnostic random integers rand.Intn(math.MaxInt64) causes tests to fail on 32-bit architectures. Use the simpler rand.Int() instead, which still provides plenty of room for generating pseudo-random test usernames. --- internal/api/api_integration_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/api/api_integration_test.go b/internal/api/api_integration_test.go index 141dcf64..9259b590 100644 --- a/internal/api/api_integration_test.go +++ b/internal/api/api_integration_test.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io" - "math" "math/rand" "os" "strings" @@ -58,7 +57,7 @@ func (c *integrationTestConfig) isConfigured() bool { } func (c *integrationTestConfig) genRandomUsername() string { - return fmt.Sprintf("%s_%10d", c.testRegularUsername, rand.Intn(math.MaxInt64)) + return fmt.Sprintf("%s_%10d", c.testRegularUsername, rand.Int()) } func TestIncorrectEndpoint(t *testing.T) {