clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

a fake clock for golang

Results 22 clockwork issues
Sort by recently updated
recently updated
newest added

In terms of features, the addition of `AfterFunc` is the main benefit here. Otherwise it addresses a number of bugs, mainly around out-of-order or duplicate delivery of events, as exposed...

Without this iterface, there is an unresolvable race condition with `After` vs. `Advance`. In one go routine, you might: ```go deadline := /* some deadline in the future */; wait...

I know that the real clock doesn't guarantee that timers will go off exactly on time, but in practice they go off somewhat close to on schedule. I just created...

I didn't see a way to build the equivalent of `time.AfterFunc` using the public APIs without leaking a goroutine and the callback func. With the internal APIs, it's pretty easy.

Fixes https://github.com/jonboulle/clockwork/issues/42.

I noticed that there appears to be a race condition in the fake timer implementation. If `Reset` gets called multiple times then apparently it can schedule multiple channel events. I...

With the current implementation of `FakeClock` updates are lost if more than one is generated at a time. If, for example, one has a ticker that fires every five minutes...

I'm trying to use FakeTicker to test production code that uses clockwork.Ticker. I found that my FakeTicker would "race ahead", since it doesn't block on ft.c being available to receive...

- 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. -...

release-note/breaking-change
release-note/new-feature

Hey folks. I started using the library and found a missing piece that is very helpful for my case. We use both time related functions and context.Timeout, but we want...