Quellcode durchsuchen

test(resource): fix flaky test

Sometimes this test might retry more times, so we check the prefix
of the trace only.
Thales Macedo Garitezi vor 3 Jahren
Ursprung
Commit
164440fe83
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  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)