Skip to content

Commit 5b5bb2e

Browse files
authored
SQS delete-message idempodency test stub (#29401)
1 parent cfdf504 commit 5b5bb2e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ydb/core/http_proxy/ut/sqs_topic_ut.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,27 @@ Y_UNIT_TEST_SUITE(TestSqsTopicHttpProxy) {
535535
DeleteMessage({{"QueueUrl", path.QueueUrl}, {"ReceiptHandle", receiptHandle}});
536536
}
537537

538+
Y_UNIT_TEST_F(TestDeleteMessageIdempotence, TFixture) {
539+
auto driver = MakeDriver(*this);
540+
const TSqsTopicPaths path;
541+
bool a = CreateTopic(driver, path.TopicName, path.ConsumerName);
542+
UNIT_ASSERT(a);
543+
TString body = "MessageBody-0";
544+
SendMessage({{"QueueUrl", path.QueueUrl}, {"MessageBody", body}});
545+
auto json = ReceiveMessage({{"QueueUrl", path.QueueUrl}, {"WaitTimeSeconds", 20}});
546+
547+
UNIT_ASSERT_VALUES_EQUAL(json["Messages"].GetArray().size(), 1);
548+
UNIT_ASSERT_VALUES_EQUAL(json["Messages"][0]["Body"], body);
549+
550+
auto receiptHandle = json["Messages"][0]["ReceiptHandle"].GetString();
551+
UNIT_ASSERT(!receiptHandle.empty());
552+
553+
DeleteMessage({{"QueueUrl", path.QueueUrl}, {"ReceiptHandle", receiptHandle}});
554+
if (!"X-Fail") { // TODO MLP commit idempotence
555+
DeleteMessage({{"QueueUrl", path.QueueUrl}, {"ReceiptHandle", receiptHandle}});
556+
}
557+
}
558+
538559
Y_UNIT_TEST_F(TestDeleteMessageBatch, TFixture) {
539560
auto driver = MakeDriver(*this);
540561
const TSqsTopicPaths path;

0 commit comments

Comments
 (0)