Skip to content

Commit

Permalink
Fix flaky test suite (#84602) (#84668)
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner authored Dec 1, 2020
1 parent e874c6f commit 153a97b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/api_integration/apis/saved_objects/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function getLogMock() {
export default ({ getService }: FtrProviderContext) => {
const esClient = getService('es');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/84438
describe.skip('Kibana index migration', () => {
describe('Kibana index migration', () => {
before(() => esClient.indices.delete({ index: '.migrate-*' }));

it('Migrates an existing index that has never been migrated before', async () => {
Expand Down Expand Up @@ -313,7 +312,10 @@ export default ({ getService }: FtrProviderContext) => {
result
// @ts-expect-error destIndex exists only on MigrationResult status: 'migrated';
.map(({ status, destIndex }) => ({ status, destIndex }))
.sort((a) => (a.destIndex ? 0 : 1))
.sort(({ destIndex: a }, { destIndex: b }) =>
// sort by destIndex in ascending order, keeping falsy values at the end
(a && !b) || a < b ? -1 : (!a && b) || a > b ? 1 : 0
)
).to.eql([
{ status: 'migrated', destIndex: '.migration-c_2' },
{ status: 'skipped', destIndex: undefined },
Expand Down

0 comments on commit 153a97b

Please sign in to comment.