Skip to content

Commit

Permalink
Fixing flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Janusz Jakubiec authored and Janusz Jakubiec committed May 9, 2023
1 parent 662cb8e commit 9feac2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions big_tests/tests/service_mongoose_system_metrics_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ all_clustered_mongooses_report_the_same_client_id(_Config) ->
system_metrics_are_reported_to_google_analytics_when_mim_starts(_Config) ->
mongoose_helper:wait_until(fun is_host_count_reported/0, true),
mongoose_helper:wait_until(fun are_modules_reported/0, true),
events_are_reported_to_primary_tracking_id(),
mongoose_helper:wait_until(fun events_are_reported_to_primary_tracking_id/0, true),
all_event_have_the_same_client_id().

system_metrics_are_reported_to_configurable_google_analytics(_Config) ->
mongoose_helper:wait_until(fun is_host_count_reported/0, true),
mongoose_helper:wait_until(fun are_modules_reported/0, true),
events_are_reported_to_both_tracking_ids(),
mongoose_helper:wait_until(fun events_are_reported_to_both_tracking_ids/0, true),
all_event_have_the_same_client_id().

system_metrics_are_reported_to_a_json_file(_Config) ->
Expand Down Expand Up @@ -466,7 +466,7 @@ events_are_reported_to_tracking_ids(ConfiguredTrackingIds) ->
Tab = ets:tab2list(?ETS_TABLE),
ActualTrackingIds = lists:usort([InstanceId || #event{instance_id = InstanceId} <- Tab]),
ExpectedTrackingIds = lists:sort([list_to_binary(Tid) || #{id := Tid} <- ConfiguredTrackingIds]),
?assertEqual(ExpectedTrackingIds, ActualTrackingIds).
ExpectedTrackingIds =:= ActualTrackingIds.

is_feature_reported(EventName, Key) ->
length(match_events(EventName, Key)) > 0.
Expand Down

0 comments on commit 9feac2a

Please sign in to comment.