From 5ecf2782fa61a3c43b7239f415a83b114b789e2f Mon Sep 17 00:00:00 2001 From: Naeel Date: Thu, 9 Apr 2026 17:12:26 +0300 Subject: [PATCH] fix: JSON protocol for Batch ops + CMV test (61/61 PASS) - SendMessageBatch/DeleteMessageBatch: JSON tags Successful/Failed for AWS CLI v2 - Fix CMV test: capture receipt handle from same receive that checks visibility --- shared-sqs/app/models/responses.go | 20 ++++++++++---------- shared-sqs/tests/hardcore_test.sh | 7 +++---- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/shared-sqs/app/models/responses.go b/shared-sqs/app/models/responses.go index 8e438f2..a69e652 100644 --- a/shared-sqs/app/models/responses.go +++ b/shared-sqs/app/models/responses.go @@ -255,8 +255,8 @@ type SendMessageBatchResponse struct { } type SendMessageBatchResult struct { - Entry []SendMessageBatchResultEntry `json:"SendMessageBatchResultEntry" xml:"SendMessageBatchResultEntry"` - Error []BatchResultErrorEntry `json:"BatchResultErrorEntry,omitempty" xml:"BatchResultErrorEntry,omitempty"` + Entry []SendMessageBatchResultEntry `json:"Successful" xml:"SendMessageBatchResultEntry"` + Error []BatchResultErrorEntry `json:"Failed,omitempty" xml:"BatchResultErrorEntry,omitempty"` } func (r SendMessageBatchResponse) GetResult() interface{} { @@ -317,24 +317,24 @@ func (r DeleteQueueResponse) GetRequestId() string { /*** Delete Message Batch Response ***/ type DeleteMessageBatchResultEntry struct { -Id string `json:"Id" xml:"Id"` + Id string `json:"Id" xml:"Id"` } type DeleteMessageBatchResult struct { -Successful []DeleteMessageBatchResultEntry `json:"DeleteMessageBatchResultEntry" xml:"DeleteMessageBatchResultEntry"` -Failed []BatchResultErrorEntry `json:"BatchResultErrorEntry,omitempty" xml:"BatchResultErrorEntry,omitempty"` + Successful []DeleteMessageBatchResultEntry `json:"Successful" xml:"DeleteMessageBatchResultEntry"` + Failed []BatchResultErrorEntry `json:"Failed,omitempty" xml:"BatchResultErrorEntry,omitempty"` } type DeleteMessageBatchResponse struct { -Xmlns string `json:"Xmlns" xml:"xmlns,attr"` -Result DeleteMessageBatchResult `json:"DeleteMessageBatchResult" xml:"DeleteMessageBatchResult"` -Metadata ResponseMetadata `json:"ResponseMetadata" xml:"ResponseMetadata"` + Xmlns string `json:"Xmlns" xml:"xmlns,attr"` + Result DeleteMessageBatchResult `json:"DeleteMessageBatchResult" xml:"DeleteMessageBatchResult"` + Metadata ResponseMetadata `json:"ResponseMetadata" xml:"ResponseMetadata"` } func (r DeleteMessageBatchResponse) GetResult() interface{} { -return r.Result + return r.Result } func (r DeleteMessageBatchResponse) GetRequestId() string { -return r.Metadata.RequestId + return r.Metadata.RequestId } diff --git a/shared-sqs/tests/hardcore_test.sh b/shared-sqs/tests/hardcore_test.sh index 4ca3693..98716cf 100644 --- a/shared-sqs/tests/hardcore_test.sh +++ b/shared-sqs/tests/hardcore_test.sh @@ -435,12 +435,11 @@ check_not "Visibility: скрыто сразу после receive" "$R" "vis-msg # Ждём истечения visibility window sleep 3 -# После паузы — снова доступно -R=$(sqs "$T1_AK" "$T1_SK" receive-message --queue-url "$VIS_QURL") -check "Visibility: сообщение снова доступно" "$R" "vis-msg-${TS}" +# После паузы — снова доступно (получаем с VT=30 и сохраняем receipt для CMV) +R3=$(sqs "$T1_AK" "$T1_SK" receive-message --queue-url "$VIS_QURL" --visibility-timeout 30) +check "Visibility: сообщение снова доступно" "$R3" "vis-msg-${TS}" # ChangeMessageVisibility — продлить время скрытия ДО истечения -R3=$(sqs "$T1_AK" "$T1_SK" receive-message --queue-url "$VIS_QURL" --visibility-timeout 30) VIS_RECEIPT=$(echo "$R3" | jq -r '.Messages[0].ReceiptHandle' 2>/dev/null) if [ -n "$VIS_RECEIPT" ] && [ "$VIS_RECEIPT" != "null" ]; then R=$(sqs "$T1_AK" "$T1_SK" change-message-visibility \