[Remote clusters] Fix API integration test flakiness (#39511)

This commit is contained in:
Sébastien Loix 2019-07-02 17:45:40 +02:00 committed by Alison Goryachev
parent c78cfbb0f5
commit 871045e675

View file

@ -9,6 +9,7 @@ import { API_BASE_PATH, NODE_SEED } from './constants';
export default function ({ getService }) {
const supertest = getService('supertest');
const retry = getService('retry');
describe('Remote Clusters', function () {
this.tags(['skipCloud']);
@ -95,28 +96,28 @@ export default function ({ getService }) {
});
describe('List', () => {
// FLAKY: https://github.com/elastic/kibana/issues/39486
it.skip('should return an array of remote clusters', async () => {
it('should return an array of remote clusters', async () => {
const uri = `${API_BASE_PATH}`;
const { body } = await supertest
.get(uri)
.expect(200);
await retry.try(async () => {
// The API to connect a remote clusters is not synchronous so we need to retry several times to avoid any flakiness.
const { body } = await supertest.get(uri);
expect(body).to.eql([
{
name: 'test_cluster',
seeds: [
NODE_SEED
],
isConnected: true,
connectedNodesCount: 1,
maxConnectionsPerCluster: 3,
initialConnectTimeout: '30s',
skipUnavailable: false,
isConfiguredByNode: false,
}
]);
expect(body).to.eql([
{
name: 'test_cluster',
seeds: [
NODE_SEED
],
isConnected: true,
connectedNodesCount: 1,
maxConnectionsPerCluster: 3,
initialConnectTimeout: '30s',
skipUnavailable: false,
isConfiguredByNode: false,
}
]);
});
});
});