mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
(cherry picked from commit 57aefd0a6b
)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
This commit is contained in:
parent
785f7396db
commit
664b0e98f0
1 changed files with 11 additions and 3 deletions
|
@ -8,6 +8,7 @@
|
|||
import { spawn } from 'child_process';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
|
||||
import pRetry from 'p-retry';
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
@ -49,8 +50,12 @@ export function useDockerRegistry() {
|
|||
await delay(3000);
|
||||
}
|
||||
|
||||
if (isExited && dockerProcess.exitCode !== 0) {
|
||||
throw new Error(`Unable to setup docker registry exit code ${dockerProcess.exitCode}`);
|
||||
}
|
||||
|
||||
dockerProcess.kill();
|
||||
throw new Error('Unable to setup docker registry');
|
||||
throw new pRetry.AbortError('Unable to setup docker registry after timeout');
|
||||
}
|
||||
|
||||
async function cleanupDockerRegistryServer() {
|
||||
|
@ -60,8 +65,11 @@ export function useDockerRegistry() {
|
|||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setTimeout(5 * 60 * 1000); // 5 minutes timeout
|
||||
await startDockerRegistryServer();
|
||||
const testTimeout = 5 * 60 * 1000; // 5 minutes timeout
|
||||
jest.setTimeout(testTimeout);
|
||||
await pRetry(() => startDockerRegistryServer(), {
|
||||
retries: 3,
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue