@camunda/e2e-test-suite 0.0.488 → 0.0.489
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4889,40 +4889,47 @@ if [[ -n "$UW_DEFINITION_KEY" ]]; then
|
|
|
4889
4889
|
|
|
4890
4890
|
# Immediately suspend to catch initialization race condition
|
|
4891
4891
|
# Use retry logic to handle eventual consistency (batch may not be indexed yet)
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
echo "
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4892
|
+
# Batch 1 is kept ACTIVE so the main suspension endpoint test (below) can use it;
|
|
4893
|
+
# only run the immediate-suspension race-condition test on batches 2 and 3.
|
|
4894
|
+
if [[ $batch_num -ne 1 ]]; then
|
|
4895
|
+
echo " Attempting immediate suspension (race condition test)..."
|
|
4896
|
+
immediate_suspend_success=false
|
|
4897
|
+
for suspend_retry in 1 2 3; do
|
|
4898
|
+
immediate_suspend_response="$(call_api_json_no_tenant "POST" "/v2/batch-operations/$batch_key/suspension" "" 2>&1)"
|
|
4899
|
+
immediate_suspend_status="$(echo "$immediate_suspend_response" | extract_status)"
|
|
4900
|
+
immediate_suspend_body="$(echo "$immediate_suspend_response" | get_body)"
|
|
4901
|
+
immediate_suspend_error="$(echo "$immediate_suspend_body" | jq -r '.message // .error // .detail // empty' 2>/dev/null)"
|
|
4902
|
+
|
|
4903
|
+
if [[ "$immediate_suspend_status" == "204" ]]; then
|
|
4904
|
+
echo " ✓ Immediate suspension successful (attempt $suspend_retry/3, status: 204)"
|
|
4905
|
+
immediate_suspend_success=true
|
|
4906
|
+
break
|
|
4907
|
+
elif [[ "$immediate_suspend_status" == "404" ]]; then
|
|
4908
|
+
if [[ $suspend_retry -lt 3 ]]; then
|
|
4909
|
+
echo " Batch not yet indexed (404), retrying in 0.1s (attempt $suspend_retry/3)..."
|
|
4910
|
+
sleep 0.1
|
|
4911
|
+
else
|
|
4912
|
+
echo " Immediate suspension failed after 3 attempts (still getting 404)"
|
|
4913
|
+
fi
|
|
4908
4914
|
else
|
|
4909
|
-
echo " Immediate suspension
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
echo -e " ${RED}⚠ POTENTIAL RACE CONDITION DETECTED during immediate suspension of batch $batch_num!${NC}"
|
|
4917
|
-
immediate_suspend_success=true # Race condition detected is a "success" for our test
|
|
4915
|
+
echo " Immediate suspension status: $immediate_suspend_status"
|
|
4916
|
+
if [[ -n "$immediate_suspend_error" ]]; then
|
|
4917
|
+
echo " Immediate suspension error: $immediate_suspend_error"
|
|
4918
|
+
if [[ "$immediate_suspend_error" =~ "foreign-key constraint"|"BATCH_OPERATION_CHUNKS"|"ZeebeDbInconsistentException"|"concurrent modification"|"already exists" ]]; then
|
|
4919
|
+
echo -e " ${RED}⚠ POTENTIAL RACE CONDITION DETECTED during immediate suspension of batch $batch_num!${NC}"
|
|
4920
|
+
immediate_suspend_success=true # Race condition detected is a "success" for our test
|
|
4921
|
+
fi
|
|
4918
4922
|
fi
|
|
4923
|
+
break
|
|
4919
4924
|
fi
|
|
4920
|
-
|
|
4925
|
+
done
|
|
4926
|
+
|
|
4927
|
+
if [[ "$immediate_suspend_success" == "false" ]]; then
|
|
4928
|
+
echo " ⚠ Could not immediately suspend batch $batch_num (eventual consistency delay)"
|
|
4921
4929
|
fi
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
echo " ⚠ Could not immediately suspend batch $batch_num (eventual consistency delay)"
|
|
4930
|
+
else
|
|
4931
|
+
# Batch 1 stays ACTIVE so the main suspension endpoint test can test it
|
|
4932
|
+
immediate_suspend_success=false
|
|
4926
4933
|
fi
|
|
4927
4934
|
else
|
|
4928
4935
|
echo " Failed to get batch operation key"
|