Tracker v3 to v5 DB integration tests use assertEquals()
to compare arrays. AssertEquals requires array elements to be in the same order as the expected array. Here, it is used to compare user group permissions on fields, but there is no inherent order to those permissions. The order of those permissions has no business meaning.
AssertEquals makes the test flaky because the order of array elements can change (since it depends on the DB). We should use other assertions such as assertEqualsCanonicalizing()
that are not affected by the order of elements.
--- Expected
tests_1 | +++ Actual
tests_1 | @@ @@
tests_1 | Array (
tests_1 | 1 => Array (...)
tests_1 | 3 => Array (
tests_1 | - 0 => 'PLUGIN_TRACKER_FIELD_UPDATE'
tests_1 | - 1 => 'PLUGIN_TRACKER_FIELD_SUBMIT'
tests_1 | + 0 => 'PLUGIN_TRACKER_FIELD_SUBMIT'
tests_1 | + 1 => 'PLUGIN_TRACKER_FIELD_UPDATE'
tests_1 | )
tests_1 | )
This was found by the Nightly run of tests.