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

Add Expirations() and BlockUntilContext(...) to FakeClock. #69

Closed
wants to merge 1 commit into from

Conversation

DPJacques
Copy link
Collaborator

@DPJacques DPJacques commented Jul 15, 2023

  • Expirations() allows callers to validate that AfterFunc was not called.
  • BlockUntilContext(...) added to FakeClock. It was added to fakeClock previously but never exposed in the interface. Oops.
  • Other NITs: documentation, spellin'

We choose to add both functions in the same commit because any change to the interface requires toilsome updates by downstream users who impelement the interface*. Might as well do both functions at once.

"Go interfaces generally belong in the package that consumes values of the interface type, not a package that implements the interface type." - https://google.github.io/styleguide/go/decisions.html#interfaces

For clarification, the above quote doesn't apply to clockwork.Clock because providing that interface is the intent of this package. However, clockwork.FakeClock's status as an interface means we break downstream users every time we update it :(

@DPJacques DPJacques added release-note/breaking-change Release note: Breaking Changes release-note/deprecation Release note: Deprecations release-note/new-feature Release note: Exciting New Features labels Jul 15, 2023
@DPJacques DPJacques linked an issue Jul 15, 2023 that may be closed by this pull request
@DPJacques DPJacques mentioned this pull request Jul 15, 2023
@DPJacques DPJacques removed the release-note/deprecation Release note: Deprecations label Jul 15, 2023
@DPJacques DPJacques force-pushed the expirations branch 2 times, most recently from 95384d7 to 3c0a225 Compare July 16, 2023 01:37
- Expirations() allows callers to validate that AfterFunc was not called.
- BlockUntilContext(...) was added to fakeClock previously but never exposed in
  the interface. Oops.
- Other NITs: documentation, spellin'

We choose to add both functions in the same commit becuase any change to the
interface requires toilsome updates by downstream users. Might as well do both
functions at once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/breaking-change Release note: Breaking Changes release-note/new-feature Release note: Exciting New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchronous Timers?
1 participant