mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Fleet] API integration test make docker server waitForLogline timeout configurable (#140128)
This commit is contained in:
parent
f7d1d6769d
commit
feeee2a5fe
4 changed files with 6 additions and 2 deletions
|
@ -71,6 +71,7 @@ const dockerServerSchema = () =>
|
|||
port: requiredWhenEnabled(Joi.number()),
|
||||
portInContainer: requiredWhenEnabled(Joi.number()),
|
||||
waitForLogLine: Joi.alternatives(Joi.object().instance(RegExp), Joi.string()).optional(),
|
||||
waitForLogLineTimeoutMs: Joi.number().integer().optional(),
|
||||
waitFor: Joi.func().optional(),
|
||||
args: Joi.array().items(Joi.string()).optional(),
|
||||
})
|
||||
|
|
|
@ -14,6 +14,7 @@ export interface DockerServerSpec {
|
|||
port: number;
|
||||
image: string;
|
||||
waitForLogLine?: RegExp | string;
|
||||
waitForLogLineTimeoutMs?: number;
|
||||
/** a function that should return an observable that will allow the tests to execute as soon as it emits anything */
|
||||
waitFor?: (server: DockerServer, logLine$: Rx.Observable<string>) => Rx.Observable<unknown>;
|
||||
/* additional command line arguments passed to docker run */
|
||||
|
|
|
@ -101,7 +101,7 @@ export class DockerServersService {
|
|||
|
||||
private async startServer(server: DockerServer) {
|
||||
const { log, lifecycle } = this;
|
||||
const { image, name, waitFor, waitForLogLine } = server;
|
||||
const { image, name, waitFor, waitForLogLine, waitForLogLineTimeoutMs } = server;
|
||||
|
||||
// pull image from registry
|
||||
log.info(`[docker:${name}] pulling docker image "${image}"`);
|
||||
|
@ -200,7 +200,8 @@ export class DockerServersService {
|
|||
: line.includes(waitForLogLine)
|
||||
)
|
||||
),
|
||||
`waitForLogLine didn't emit anything`
|
||||
`waitForLogLine didn't emit anything`,
|
||||
waitForLogLineTimeoutMs
|
||||
)
|
||||
).toPromise();
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
port: registryPort,
|
||||
args: dockerArgs,
|
||||
waitForLogLine: 'package manifests loaded',
|
||||
waitForLogLineTimeoutMs: 60 * 2 * 10000, // 2 minutes
|
||||
},
|
||||
}),
|
||||
services: xPackAPITestsConfig.get('services'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue