Skip to content

Conversation

@luc-lisi
Copy link
Contributor

@luc-lisi luc-lisi commented Nov 5, 2025

Previously we had tests performing real timeouts to test caching behavior (specifically in regards to testing TTL logic). We have updated them to now have it be possible to build the cache with a "TestClock" which lets developers manually increment the system time.

This should speed up tests and also prevent non-deterministic behavior.

This does not affect production and we have included an extra local integration test that verifies this.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@luc-lisi luc-lisi force-pushed the refactor-ads-client-with-mock-time branch 4 times, most recently from 5deb50d to ef9c71b Compare November 5, 2025 21:20
}
#[cfg(test)]
fn advance(&self, _secs: i64) {
panic!(
Copy link
Contributor Author

@luc-lisi luc-lisi Nov 5, 2025

Choose a reason for hiding this comment

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

This looks funny. But maybe it's fine seeing as it's just test code? I couldn't find a super clean way to type this otherwise but maybe someone else has some ideas.

inline not needed

cleanup

wording

fixed

reorg
@luc-lisi luc-lisi force-pushed the refactor-ads-client-with-mock-time branch from ef9c71b to e25da93 Compare November 6, 2025 21:39
@luc-lisi luc-lisi added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit 47a5db1 Nov 6, 2025
13 checks passed
@luc-lisi luc-lisi deleted the refactor-ads-client-with-mock-time branch November 6, 2025 22:42
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