From d5e92b4bed13606349ab6098ad76e6b877e201f8 Mon Sep 17 00:00:00 2001 From: zmstone Date: Mon, 17 Jun 2024 22:56:03 +0200 Subject: [PATCH] test: stable brod_group_subscriber_SUITE:t_async_commit --- test/brod_group_subscriber_SUITE.erl | 3 ++- test/brod_topic_subscriber_SUITE.erl | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/brod_group_subscriber_SUITE.erl b/test/brod_group_subscriber_SUITE.erl index d55dea72..7ad69d14 100644 --- a/test/brod_group_subscriber_SUITE.erl +++ b/test/brod_group_subscriber_SUITE.erl @@ -550,6 +550,7 @@ t_async_commit({init, Config}) -> integer_to_list(rand:uniform(1000000000))), [{group_id, GroupId} | Config]; t_async_commit(Config) when is_list(Config) -> + GroupId = ?config(group_id), Behavior = ?config(behavior), Topic = ?topic, Partition = 0, @@ -562,7 +563,7 @@ t_async_commit(Config) when is_list(Config) -> , {partition_restart_delay_seconds, 1} , {begin_offset, Offset} ], - {ok, SubscriberPid} = start_subscriber(?group_id, Config, [Topic], + {ok, SubscriberPid} = start_subscriber(GroupId, Config, [Topic], GroupConfig, ConsumerConfig, InitArgs), SubscriberPid diff --git a/test/brod_topic_subscriber_SUITE.erl b/test/brod_topic_subscriber_SUITE.erl index 362518f0..db61189d 100644 --- a/test/brod_topic_subscriber_SUITE.erl +++ b/test/brod_topic_subscriber_SUITE.erl @@ -211,7 +211,7 @@ t_consumer_ack_via_message_passing(Config) when is_list(Config) -> Partition = 0, SendFun = fun(I) -> - produce({?topic, Partition}, <>) + produce({?topic, Partition}, integer_to_binary(I)) end, ?check_trace( %% Run stage: @@ -225,12 +225,12 @@ t_consumer_ack_via_message_passing(Config) when is_list(Config) -> {ok, SubscriberPid} = brod:start_link_topic_subscriber(?CLIENT_ID, ?topic, ConsumerConfig, ?MODULE, InitArgs), - {ok, _} = wait_message(<<1>>), + {ok, _} = wait_message(<<"1">>), %% ack_offset allows consumer to proceed to message 2 SubscriberPid ! {ack_offset, 0, Offset0}, - {ok, _} = wait_message(<<2>>), + {ok, _} = wait_message(<<"2">>), ok = brod_topic_subscriber:stop(SubscriberPid), - _Expected = [<<1>>, <<2>>] + _Expected = [<<"1">>, <<"2">>] end, %% Check stage: fun(Expected, Trace) ->