Skip to content

Commit 802a4fa

Browse files
author
Spencer
authored
[migrations/tests] sort results before assertion (#23347) (#23350)
There have been several failures in this test, seemingly caused by a lack of sorting in the results. It makes sense that since both migrations are run simultaneously that sometimes one would succeed and sometimes another would, so I've just sorted the results before checking. ![image](https://user-images.githubusercontent.com/1329312/45791153-44e9cc80-bc3d-11e8-88c4-760d4c7b35bd.png) cc: @chrisdavies
1 parent cd743dc commit 802a4fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/api_integration/apis/saved_objects/migrations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export default ({ getService }) => {
181181
// The polling instance and the migrating instance should both
182182
// return a similar migraiton result.
183183
assert.deepEqual(
184-
result.map(({ status, destIndex }) => ({ status, destIndex })),
184+
result.map(({ status, destIndex }) => ({ status, destIndex })).sort((a) => a.destIndex ? 0 : 1),
185185
[
186186
{ status: 'migrated', destIndex: '.migration-c_2' },
187187
{ status: 'skipped', destIndex: undefined },

0 commit comments

Comments
 (0)