jonboulle / clockwork

a fake clock for golang
Apache License 2.0
656 stars 58 forks source link

Make FakeTicker synchronous #47

Closed dbenbenn closed 1 year ago

dbenbenn commented 2 years ago

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

I make it synchronous, and add a test case showing the behavior.

sagikazarmark commented 1 year ago

I wonder if #44 solves this.

sagikazarmark commented 1 year ago

After reviewing this and the recent changes: that "race ahead" is how the "real" ticker behaves, so it works as intended in the fake ticker.