Tags: coder/quartz
Tags
fix: support Go 1.23+ timer & ticker channel behavior (#23) fixes #22 Changes mock ticker and timer implementations based on channels to match Go 1.23+. c.f. https://go.dev/wiki/Go123Timer 1. Channels for tickers and timers are now unbuffered. 2. Channels reads will block after `Stop()` returns. 3. We use goroutines to write to the unbuffered channels. In order to avoid leaking go routines, when the test ends, any uncompleted channel writes are abandoned. This means that reads from the channels will block after the test exits. This is usually what you want, but is a small difference in behavior from before, where we wrote to a _buffered_ channel, and so reads could complete after the test completed.
fix: stop logging after test cleanup (#19) Fixes Quartz so we don't accidentally log after the test ends, which [can cause racy test failures](https://app.graphite.dev/github/pr/coder/coder/18007/chore-updated-to-coder%2Fquartz-v0.2.0#discussion-IC_kwDOGkVX1s6tQd_u)
!feat: Call.Release takes context; add MustRelease (#17) **BREAKING CHANGE** Adds a `context.Context` to `(*Call.).Release()` and a new `MustRelease()`, since releasing a call can be blocking. Use like ``` err := call.Release(ctx) if err != nil { t.Error(err.Error()) } ``` or more succinctly ``` call.MustRelease(ctx) ``` This, combined with a per-test timeout context, should make it much easier to debug issues if you have a call that gets trapped by more than one trap.