From fc849f0c05325c8d289dc53aed128efad248e93e Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 22 Nov 2023 12:36:10 -0300 Subject: [PATCH] ci(test): add info to help diagnose flaky test --- .../test/emqx_bridge_gcp_pubsub_consumer_SUITE.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/emqx_bridge_gcp_pubsub/test/emqx_bridge_gcp_pubsub_consumer_SUITE.erl b/apps/emqx_bridge_gcp_pubsub/test/emqx_bridge_gcp_pubsub_consumer_SUITE.erl index be6a306e0..5e1e885db 100644 --- a/apps/emqx_bridge_gcp_pubsub/test/emqx_bridge_gcp_pubsub_consumer_SUITE.erl +++ b/apps/emqx_bridge_gcp_pubsub/test/emqx_bridge_gcp_pubsub_consumer_SUITE.erl @@ -1494,10 +1494,11 @@ t_pull_worker_death(Config) -> ok. t_async_worker_death_mid_pull(Config) -> - ct:timetrap({seconds, 120}), + ct:timetrap({seconds, 122}), [#{pubsub_topic := PubSubTopic}] = ?config(topic_mapping, Config), Payload = emqx_guid:to_hexstr(emqx_guid:gen()), ?check_trace( + #{timetrap => 120_000}, begin start_and_subscribe_mqtt(Config), @@ -1513,18 +1514,22 @@ t_async_worker_death_mid_pull(Config) -> #{?snk_kind := gcp_pubsub_consumer_worker_reply_delegator} ), spawn_link(fun() -> + ct:pal("will kill async worker"), ?tp_span( kill_async_worker, #{}, begin %% produce a message while worker is being killed Messages = [#{<<"data">> => Payload}], + ct:pal("publishing message"), pubsub_publish(Config, PubSubTopic, Messages), + ct:pal("published message"), AsyncWorkerPids = get_async_worker_pids(Config), emqx_utils:pmap( fun(AsyncWorkerPid) -> Ref = monitor(process, AsyncWorkerPid), + ct:pal("killing pid ~p", [AsyncWorkerPid]), sys:terminate(AsyncWorkerPid, die), receive {'DOWN', Ref, process, AsyncWorkerPid, _} -> @@ -1538,7 +1543,8 @@ t_async_worker_death_mid_pull(Config) -> ok end - ) + ), + ct:pal("killed async worker") end), ?assertMatch(