testkit: add clockStart parameter to TestControl.execute and executeE…
Description
Adds optional clockStart parameter to TestControl.execute and executeEmbed to set initial time offset, making it easier to test time-sensitive code at specific timestamps.
Use Case
This directly addresses the need for testing time-sensitive functionality like HTTP message signatures, authentication tokens, and expiration logic at specific timestamps.
// Before
TestControl.execute(program).flatMap { control =>
control.tick *> control.advance(timestamp) *> control.tick *> control.results
}
// After
TestControl.executeEmbed(program, clockStart = timestamp)
Backward compatible with comprehensive test coverage.
Refs #3309
Hi @armanbilge , @samspills the macOS CI failed due to a network timeout while downloading dependencies. Could you please rerun the jobs? Thanks!
Follow-up: I also tried triggering CI with an empty commit, but the Windows job failed with a ServerAlreadyBootingException (SBT lock issue)
Backward compatible
No, it's not binary backward compatible, and mima (rightly) complained.
Backward compatible
No, it's not binary backward compatible, and mima (rightly) complained.
Thank you @durban for guidance in regard to the binary compatibility issue.
I've created #4511 with a binary-compatible approach using new methods (setTime/advanceTo) instead of modifying existing ones. All CI checks are passing.
Please look through it when you have some time
Thank you :relaxed: