Skip to content

Commit

Permalink
Fixes flaky backfill tests. (elastic#198592)
Browse files Browse the repository at this point in the history
Resolves elastic#192144
Resolves elastic#198168
Resolves elastic#197239

## Summary

Minor fixes to the backfill functional tests to try to reduce flakiness.
  • Loading branch information
ymao1 authored and mbondyra committed Nov 8, 2024
1 parent 8bd63fb commit 39827e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ export default function apiKeyBackfillTests({ getService }: FtrProviderContext)
}
});

// invoke the invalidate task
await runInvalidateTask();

// pending API key should now be deleted because backfill is done
await retry.try(async () => {
// invoke the invalidate task
await runInvalidateTask();

const results = await getApiKeysPendingInvalidation();
expect(results.length).to.eql(0);
return results;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ export default function scheduleBackfillTests({ getService }: FtrProviderContext
});

it('should handle schedule request where some requests succeed and some requests fail appropriately', async () => {
const start = moment().utc().startOf('day').subtract(7, 'days').toISOString();
const start = moment().utc().startOf('day').subtract(14, 'days').toISOString();
const end = moment().utc().startOf('day').subtract(5, 'days').toISOString();
// create 2 rules
const rresponse1 = await supertest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ export default function createBackfillTaskRunnerTests({ getService }: FtrProvide
moment().utc().startOf('day').subtract(9, 'days').add(41, 'minutes').toISOString(),
];

// FLAKY: https://github.com/elastic/kibana/issues/192144
describe.skip('ad hoc backfill task', () => {
describe('ad hoc backfill task', () => {
beforeEach(async () => {
await esTestIndexTool.destroy();
await esTestIndexTool.setup();
Expand Down Expand Up @@ -167,7 +166,7 @@ export default function createBackfillTaskRunnerTests({ getService }: FtrProvide
objectRemover.add(spaceId, ruleId, 'rule', 'alerting');

const start = moment(originalDocTimestamps[1]).utc().startOf('day').toISOString();
const end = moment().utc().startOf('day').subtract(9, 'days').toISOString();
const end = moment(originalDocTimestamps[11]).utc().startOf('day').toISOString();

// Schedule backfill for this rule
const response2 = await supertestWithoutAuth
Expand Down

0 comments on commit 39827e5

Please sign in to comment.