diff options
author | abcdef <akotov@ydb.tech> | 2023-11-27 14:33:44 +0300 |
---|---|---|
committer | abcdef <akotov@ydb.tech> | 2023-11-27 15:01:36 +0300 |
commit | 3107333bc85fb115374cdd4f772f631a418b6ea3 (patch) | |
tree | 074cf077074cf7aef416c5e3a1c11195ab97bac3 | |
parent | 2aa1a8476829a690167a8947751a95f4299cecd0 (diff) | |
download | ydb-3107333bc85fb115374cdd4f772f631a418b6ea3.tar.gz |
fixed the test TPersQueueTest::StreamReadCommitAndStatusMsgs
в ответе может быть больше одного сообщения
-rw-r--r-- | ydb/services/persqueue_v1/persqueue_ut.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ydb/services/persqueue_v1/persqueue_ut.cpp b/ydb/services/persqueue_v1/persqueue_ut.cpp index 534f58706d..37103c83be 100644 --- a/ydb/services/persqueue_v1/persqueue_ut.cpp +++ b/ydb/services/persqueue_v1/persqueue_ut.cpp @@ -615,11 +615,13 @@ Y_UNIT_TEST_SUITE(TPersQueueTest) { UNIT_ASSERT(readStream->Read(&resp)); Cerr << "Got read response " << resp << "\n"; UNIT_ASSERT_C(resp.server_message_case() == Ydb::Topic::StreamReadMessage::FromServer::kReadResponse, resp); - UNIT_ASSERT(resp.read_response().partition_data_size() == 1); - UNIT_ASSERT(resp.read_response().partition_data(0).batches_size() == 1); - UNIT_ASSERT(resp.read_response().partition_data(0).batches(0).message_data_size() >= 1); - UNIT_ASSERT(resp.read_response().partition_data(0).batches(0).message_data(0).offset() == i); - i += resp.read_response().partition_data(0).batches(0).message_data_size(); + UNIT_ASSERT_VALUES_EQUAL(resp.read_response().partition_data_size(), 1); + UNIT_ASSERT_GE(resp.read_response().partition_data(0).batches_size(), 1); + for (const auto& batch : resp.read_response().partition_data(0).batches()) { + UNIT_ASSERT_GE(batch.message_data_size(), 1); + UNIT_ASSERT_VALUES_EQUAL(batch.message_data(0).offset(), i); + i += batch.message_data_size(); + } } // send commit, await commitDone |