Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[migrations/tests] sort results before assertion (elastic#23347)
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 committed Sep 20, 2018
1 parent 4beb2c6 commit 0d2a283
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 0d2a283

Please sign in to comment.