Skip to content

Conversation

@manast
Copy link
Contributor

@manast manast commented May 28, 2025

Why

We got a report of an issue (#3095 (comment)) and this test should cover that scenario.

How

Written a test that upserts a job scheduler several times and we check that the data of the next job associated with the scheduler is indeed updated.

Additional Notes (Optional)

N/A

@manast manast requested review from Copilot and roggervalf May 28, 2025 09:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new test case to verify that repeatedly upserting a job scheduler updates the data of its next scheduled job as expected.

  • Introduces an it block that upserts a scheduler four times, checking the enqueued job’s .data after each update.
  • Utilizes a fake clock (this.clock) to advance scheduling intervals deterministically.
  • Validates that the job waiting in the queue always reflects the most recent data payload.

data: { anotherKey: 'another-value-2' },
},
);

Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check occurs without advancing the fake clock, so the scheduler may not have enqueued the next job yet. Consider adding await this.clock.tickAsync(1); before retrieving waitingJobs3 for consistency with the other iterations.

Suggested change
await this.clock.tickAsync(1);

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@roggervalf roggervalf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants