riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
2.86k stars 68 forks source link

expose DisableStaggerStart via TestOnlyConfig #385

Closed bgentry closed 1 week ago

bgentry commented 1 month ago

I ran into an issue with some external testing where I needed to run a full River client. These tests were quite slow, and I realized it was because of StaggerStartStop—a setting that is currently not exposed outside the river package.

I'm not sure this is the right way to expose it. If we end up having a set of related knobs that can be tweaked for test usage (lowering buffers, sleep durations, etc) it's likely most of the time they'll be used all together. Open to other ways to expose this.

brandur commented 1 month ago

As discussed on Slack, my fear with the granularity here is that it's not very forward compatibility friendly. Meaning that in the future if more options were to be added like DisableStaggerStart that most tests would want to disable, people trying to disable this type of thing in tests wouldn't get the new ones unless they were paying very close attention to the changelog.

I was thinking about this one a little more overnight — what do you think about exposing TestOnly boolean for the time being, and then if the need called for it in the future, we could then expose a more granular TestOnlyConfig TestOnlyConfig property with more options?

bgentry commented 1 week ago

Superseded by #414.