Skip to content

Commit

Permalink
enhance functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
ersin-erdal committed Nov 30, 2023
1 parent 0e230a3 commit f105988
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(task.numSkippedRuns).to.eql(2);
});

let newLastRun: string;
await retry.try(async () => {
const task = await currentTask(createdTask.id);
expect(task.attempts).to.eql(0);
Expand All @@ -63,6 +64,18 @@ export default function ({ getService }: FtrProviderContext) {
expect(task.numSkippedRuns).to.eql(2);
// keeps rescheduling after skips
expect(new Date(task.runAt).getTime()).to.greaterThan(new Date(lastRunAt).getTime());
newLastRun = task.runAt;
});

// should keep running the rule after 2 skips and 1 successful run
await retry.try(async () => {
const task = await currentTask(createdTask.id);
expect(task.attempts).to.eql(0);
expect(task.retryAt).to.eql(null);
// skip attempts remains as it is
expect(task.numSkippedRuns).to.eql(2);
// keeps rescheduling after skips
expect(new Date(task.runAt).getTime()).to.greaterThan(new Date(newLastRun).getTime());
});
});

Expand Down

0 comments on commit f105988

Please sign in to comment.