increase timeout setting for the test

This commit is contained in:
restrry 2021-10-12 13:45:38 +02:00
parent 1887300f0f
commit 2e892057fb
3 changed files with 9 additions and 8 deletions

View file

@ -98,9 +98,10 @@ export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, Fixtu
transaction?.end();
subscription.unsubscribe();
});
await ctx.core.elasticsearch.client.asInternalUser.ping();
// eslint-disable-next-line no-console
console.log('>>> in handler', apmAgent.isStarted(), apmAgent.currentTraceIds);
await ctx.core.elasticsearch.client.asInternalUser.ping();
return res.ok({
body: {
traceId: apmAgent.currentTraceIds['trace.id'],

View file

@ -40,7 +40,7 @@ export async function assertLogContains({
retry: RetryService;
}): Promise<void> {
// logs are written to disk asynchronously. I sacrificed performance to reduce flakiness.
await retry.waitFor(description, async () => {
await retry.waitForWithTimeout(description, 60_000, async () => {
const logsStr = await Fs.readFile(logFilePath, 'utf-8');
const normalizedRecords = logsStr
.split(endOfLine)

View file

@ -17,16 +17,16 @@ export default function ({ getService }: FtrProviderContext) {
const response1 = await supertest.get('/emit_log_with_trace_id');
expect(response1.body.traceId).to.be.a('string');
await assertLogContains({
description: 'traceId included in the Kibana logs',
predicate: (record) => record.trace?.id === response1.body.traceId,
retry,
});
const response2 = await supertest.get('/emit_log_with_trace_id');
expect(response1.body.traceId).to.be.a('string');
expect(response2.body.traceId).not.to.be(response1.body.traceId);
await assertLogContains({
description: `traceId ${response1.body.traceId} included in the Kibana logs`,
predicate: (record) => record.trace?.id === response1.body.traceId,
retry,
});
});
});
}