Skip to content

Mock time in tests #1986

@na--

Description

@na--

Our tests, especially the ones for executors, are somewhat flaky and incomplete. Because we rely on real timers, we can't test them as well as we should... 😞

The solution is to somehow mock time. For example, instead of using functions from the time package directly, we can instead rely on an interface. For real-world code, that interface will be implemented by the same time package, so nothing would change, but for test we'd be able to manually control the time "flow"...

This was previously mentioned in #1357 (comment) and #1386 (comment), but it probably deserves its own issue, so I created this.

Specific issues that this will likely make easier: #1715, #1719, #1974

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions