Fix flaky migrations tests (#111365)
This commit is contained in:
parent
285d232601
commit
cf45c39e0f
|
@ -67,7 +67,9 @@ describe('migration v2', () => {
|
|||
await root.setup();
|
||||
await expect(root.start()).resolves.toBeTruthy();
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
// After plugins start, some saved objects are deleted/recreated, so we
|
||||
// wait a bit for the count to settle.
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
|
||||
const esClient: ElasticsearchClient = esServer.es.getClient();
|
||||
const migratedIndexResponse = await esClient.count({
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
import { retryAsync } from './retry_async';
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/110970
|
||||
describe.skip('retry', () => {
|
||||
describe('retry', () => {
|
||||
it('retries throwing functions until they succeed', async () => {
|
||||
let i = 0;
|
||||
await expect(
|
||||
|
@ -53,6 +52,8 @@ describe.skip('retry', () => {
|
|||
},
|
||||
{ retryAttempts: 3, retryDelayMs: 100 }
|
||||
);
|
||||
expect(Date.now() - now).toBeGreaterThanOrEqual(200);
|
||||
// Would expect it to take 200ms but seems like timing inaccuracies
|
||||
// sometimes causes the duration to be measured as 199ms
|
||||
expect(Date.now() - now).toBeGreaterThanOrEqual(199);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue