Skip to content

Commit 05bd6dd

Browse files
author
dcorbacho
committed
Test multiple chunks
1 parent b7a2e9a commit 05bd6dd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

deps/rabbitmq_stream/test/rabbit_stream_SUITE.erl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,13 @@ test_server(Transport, Port) ->
196196
C4 = test_declare_publisher(Transport, S, PublisherId, Stream, C3),
197197
Body = <<"hello">>,
198198
C5 = test_publish_confirm(Transport, S, PublisherId, Body, C4),
199+
C6 = test_publish_confirm(Transport, S, PublisherId, Body, C5),
199200
SubscriptionId = 42,
200-
C6 = test_subscribe(Transport, S, SubscriptionId, Stream, C5),
201-
C7 = test_deliver(Transport, S, SubscriptionId, Body, C6),
202-
C8 = test_delete_stream(Transport, S, Stream, C7),
203-
_C9 = test_close(Transport, S, C8),
201+
C7 = test_subscribe(Transport, S, SubscriptionId, Stream, C6),
202+
C8 = test_deliver(Transport, S, SubscriptionId, 0, Body, C7),
203+
C9 = test_deliver(Transport, S, SubscriptionId, 1, Body, C8),
204+
C10 = test_delete_stream(Transport, S, Stream, C9),
205+
_C11 = test_close(Transport, S, C10),
204206
closed = wait_for_socket_close(Transport, S, 10),
205207
ok.
206208

@@ -322,7 +324,7 @@ test_subscribe(Transport, S, SubscriptionId, Stream, C0) ->
322324
?assertMatch({response, 1, {subscribe, ?RESPONSE_CODE_OK}}, Cmd),
323325
C.
324326

325-
test_deliver(Transport, S, SubscriptionId, Body, C0) ->
327+
test_deliver(Transport, S, SubscriptionId, COffset, Body, C0) ->
326328
{C, [{deliver, SubscriptionId, Chunk}]} = receive_commands(Transport, S, C0),
327329
<<5:4/unsigned,
328330
0:4/unsigned,
@@ -331,7 +333,7 @@ test_deliver(Transport, S, SubscriptionId, Body, C0) ->
331333
1:32,
332334
_Timestamp:64,
333335
_Epoch:64,
334-
0:64,
336+
COffset:64,
335337
_Crc:32,
336338
_DataLength:32,
337339
_TrailerLength:32,

0 commit comments

Comments
 (0)