File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 88 "io"
99 "net/http"
1010 "strings"
11+ "sync/atomic"
1112 "testing"
1213 "time"
1314
@@ -3044,11 +3045,10 @@ func Test_AddSubIssue_RetryLogic(t *testing.T) {
30443045 name : "successful retry after priority conflict" ,
30453046 mockedClient : func () * http.Client {
30463047 // Create a handler that fails twice with priority conflict, then succeeds
3047- var callCount int32
3048+ var callCount atomic. Int32
30483049 handler := func (w http.ResponseWriter , _ * http.Request ) {
3049- count := callCount
3050- callCount ++
3051- if count < 2 {
3050+ count := callCount .Add (1 )
3051+ if count <= 2 {
30523052 // First two calls fail with priority conflict
30533053 w .WriteHeader (http .StatusUnprocessableEntity )
30543054 _ , _ = w .Write ([]byte (`{"message": "An error occurred while adding the sub-issue to the parent issue. Priority has already been taken"}` ))
You can’t perform that action at this time.
0 commit comments