diff --git a/pkg/collector/distinct_string_collector_test.go b/pkg/collector/distinct_string_collector_test.go index 60334b11150..ec778e3012c 100644 --- a/pkg/collector/distinct_string_collector_test.go +++ b/pkg/collector/distinct_string_collector_test.go @@ -18,7 +18,7 @@ func TestDistinctStringCollector(t *testing.T) { d.Collect("11") require.True(t, d.Exceeded()) - require.Equal(t, []string{"123", "4567", "890"}, d.Strings()) + stringsSlicesEqual(t, []string{"123", "4567", "890"}, d.Strings()) // diff fails when diff is not enabled res, err := d.Diff() @@ -32,14 +32,14 @@ func TestDistinctStringCollectorDiff(t *testing.T) { d.Collect("123") d.Collect("4567") - require.Equal(t, []string{"123", "4567"}, readDistinctStringDiff(t, d)) - require.Equal(t, []string{}, readDistinctStringDiff(t, d)) + stringsSlicesEqual(t, []string{"123", "4567"}, readDistinctStringDiff(t, d)) + stringsSlicesEqual(t, []string{}, readDistinctStringDiff(t, d)) d.Collect("123") d.Collect("890") - require.Equal(t, []string{"890"}, readDistinctStringDiff(t, d)) - require.Equal(t, []string{}, readDistinctStringDiff(t, d)) + stringsSlicesEqual(t, []string{"890"}, readDistinctStringDiff(t, d)) + stringsSlicesEqual(t, []string{}, readDistinctStringDiff(t, d)) } func readDistinctStringDiff(t *testing.T, d *DistinctString) []string { diff --git a/pkg/collector/distinct_value_collector_test.go b/pkg/collector/distinct_value_collector_test.go index c56dcf93068..d0bd470db97 100644 --- a/pkg/collector/distinct_value_collector_test.go +++ b/pkg/collector/distinct_value_collector_test.go @@ -23,7 +23,7 @@ func TestDistinctValueCollector(t *testing.T) { require.True(t, d.Exceeded()) require.Equal(t, stop, d.Exceeded()) // final stop should be same as Exceeded - require.Equal(t, []string{"123", "4567"}, d.Values()) + stringsSlicesEqual(t, []string{"123", "4567"}, d.Values()) // diff fails when diff is not enabled res, err := d.Diff()