From 0d2a28345973b3f2e1f36d8cb8b0a36b86065f26 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 19 Sep 2018 21:51:15 -0700 Subject: [PATCH] [migrations/tests] sort results before assertion (#23347) 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 --- test/api_integration/apis/saved_objects/migrations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/api_integration/apis/saved_objects/migrations.js b/test/api_integration/apis/saved_objects/migrations.js index 80634adfd15a26..5c46e3c09a2176 100644 --- a/test/api_integration/apis/saved_objects/migrations.js +++ b/test/api_integration/apis/saved_objects/migrations.js @@ -181,7 +181,7 @@ export default ({ getService }) => { // The polling instance and the migrating instance should both // return a similar migraiton result. assert.deepEqual( - result.map(({ status, destIndex }) => ({ status, destIndex })), + result.map(({ status, destIndex }) => ({ status, destIndex })).sort((a) => a.destIndex ? 0 : 1), [ { status: 'migrated', destIndex: '.migration-c_2' }, { status: 'skipped', destIndex: undefined },