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.

(cherry picked from commit 705c503)
  • Loading branch information
ymao1 committed Nov 7, 2024
1 parent c3bf0b4 commit cdb55f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 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 @@ -166,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 cdb55f4

Please sign in to comment.