Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Fix/1986 mock time in test #2269

Closed
wants to merge 14 commits into from
Closed

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Nov 29, 2021

This is a draft Pull Request of my attempt to mock time in test #1986 (and to hopefully get to solve #1357 in the process?). I've focused mostly on executors in lib/executor as they seemed a good first candidate.

In its current state, the PR adds a dependency to benbjohnson/clock, and integrates its Clock interface in the BaseConfig of the executors. As a default, it ensures the "standard" clock is used (the one that uses the standard library's time package under the hood), but it also allows us to use a clock.Mock instance that lets us control the passage of time.

While I was able to integrate the interface in the executors, and replace our usages of time with the added clock in the code. I've been struggling to get tests to pass using that technique: especially finding out where and when to make the time pass in the tests code.

If you have ideas, recommendations, or want/can offer some help, this PR is here for that :)

PS: this PR's branch is based upon #2268, and you can safely ignore any commit starting with "Refactor", to focus on commits starting with "WIP" instead.

@oleiade oleiade requested review from imiric and na-- November 29, 2021 17:06
@oleiade oleiade self-assigned this Nov 30, 2021
@oleiade oleiade marked this pull request as draft November 30, 2021 08:56
@na-- na-- requested review from mstoykov and codebien and removed request for na-- December 2, 2021 14:40
@na-- na-- added this to the v0.37.0 milestone Jan 5, 2022
@na-- na-- removed this from the v0.37.0 milestone Feb 16, 2022
@oleiade
Copy link
Member Author

oleiade commented Feb 16, 2022

Closed. See #1986 for more details.

@oleiade oleiade closed this Feb 16, 2022
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.

None yet

2 participants