Просмотр исходного кода

test(resource): fix flaky test

Sometimes this test might retry more times, so we check the prefix
of the trace only.
Thales Macedo Garitezi 3 лет назад
Родитель
Сommit
164440fe83
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      apps/emqx_resource/test/emqx_resource_SUITE.erl

+ 4 - 3
apps/emqx_resource/test/emqx_resource_SUITE.erl

@@ -1167,10 +1167,11 @@ t_retry_batch(_Config) ->
             %% each time should be the original batch (no duplicate
             %% elements or reordering).
             ExpectedSeenPayloads = lists:flatten(lists:duplicate(4, Payloads)),
-            ?assertEqual(
-                ExpectedSeenPayloads,
-                ?projection(n, ?of_kind(connector_demo_batch_inc_individual, Trace))
+            Trace1 = lists:sublist(
+                ?projection(n, ?of_kind(connector_demo_batch_inc_individual, Trace)),
+                length(ExpectedSeenPayloads)
             ),
+            ?assertEqual(ExpectedSeenPayloads, Trace1),
             ?assertMatch(
                 [#{n := ExpectedCount}],
                 ?of_kind(connector_demo_inc_counter, Trace)