Skip to content

Commit

Permalink
[migrations/tests] sort results before assertion (#23347) (#23350)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Spencer authored Sep 20, 2018
1 parent cd743dc commit 802a4fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/api_integration/apis/saved_objects/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit 802a4fa

Please sign in to comment.