Skip to content

Commit

Permalink
enable skipped inputs_with_standalone_docker_agent test (#202131)
Browse files Browse the repository at this point in the history
## Summary

Closes #193625

Catch es errors in the test, to let it retry.
Flaky test runner passed 125 times.


### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
  • Loading branch information
juliaElastic authored Nov 28, 2024
1 parent 51cd874 commit 0d1f89a
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export default function (providerContext: FtrProviderContext) {
const config = getService('config');
const log = getService('log');

// Failing: See https://github.com/elastic/kibana/issues/193625
describe.skip('inputs_with_standalone_docker_agent', () => {
describe('inputs_with_standalone_docker_agent', () => {
skipIfNoDockerRegistry(providerContext);
let apiKey: string;
let agent: AgentProcess;
Expand Down Expand Up @@ -77,17 +76,22 @@ ${inputsYaml}
const MAX_ITERATIONS = 20;
let foundMetrics = false;
for (let i = 0; i < MAX_ITERATIONS; i++) {
const searchRes = await es.search({
index: 'metrics-system.cpu-default',
q: `agent.name:${agent.name}`,
ignore_unavailable: true,
});

// @ts-expect-error TotalHit
if (searchRes.hits.total.value > 0) {
foundMetrics = true;
break;
try {
const searchRes = await es.search({
index: 'metrics-system.cpu-default',
q: `agent.name:${agent.name}`,
ignore_unavailable: true,
});

// @ts-expect-error TotalHit
if (searchRes.hits.total.value > 0) {
foundMetrics = true;
break;
}
} catch (err) {
log.error(err);
}

// await agent.log(); uncomment if you need to debug agent logs
await new Promise((resolve) => setTimeout(resolve, 5 * 1000));
}
Expand Down

0 comments on commit 0d1f89a

Please sign in to comment.