From 7a26aec685cd8a0a0c98c0a476ba25e2e8b4a3a5 Mon Sep 17 00:00:00 2001 From: niksis02 Date: Wed, 14 Jan 2026 15:02:41 +0400 Subject: [PATCH] fix: fix the concurrency issue in integration tests bucket name generation `getBucketName` in the integration test utilities is responsible for generating unique bucket names using the `test-bucket-` prefix and an atomic integer. The previous implementation performed an atomic `Add` followed by a `Load`, which does not guarantee uniqueness and could result in duplicate bucket names. This has been fixed by removing the `Load` call and relying solely on the return value of the `Add` operation, which provides the updated integer value. --- tests/integration/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/utils.go b/tests/integration/utils.go index aae52c2..b9cda7b 100644 --- a/tests/integration/utils.go +++ b/tests/integration/utils.go @@ -66,8 +66,8 @@ type user struct { } func getBucketName() string { - bcktCount.Add(1) - return fmt.Sprintf("test-bucket-%v", bcktCount.Load()) + val := bcktCount.Add(1) + return fmt.Sprintf("test-bucket-%v", val) } func getUser(role string) user {