Skip to content

Conversation

najuna-brian
Copy link

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

@najuna-brian
Copy link
Author

najuna-brian commented Oct 13, 2025

Hi @armanbilge , @samspills the macOS CI failed due to a network timeout while downloading dependencies. Could you please rerun the jobs? Thanks!

@najuna-brian
Copy link
Author

Follow-up: I also tried triggering CI with an empty commit, but the Windows job failed with a ServerAlreadyBootingException (SBT lock issue)

@najuna-brian najuna-brian marked this pull request as ready for review October 14, 2025 04:36
@najuna-brian najuna-brian marked this pull request as draft October 14, 2025 08:44
@durban
Copy link
Contributor

durban commented Oct 14, 2025

Backward compatible

No, it's not binary backward compatible, and mima (rightly) complained.

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.

2 participants