-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Using ":until_executing, :until_executed, :until_timeout, :until_and_while_executing" all break Sidekiq::Testing #157
Comments
I'm having the same issue. |
Same here. Even though I test my workers with My wreck looks even bigger, when including
|
For the sake of runtime performance and reliability the gem is now relying completely on lua. I'd suggest you look into running your tests using something like docker if having redis running is a problem. It doesn't make sense trying to replicate what the lua scripts do in memory. It caused the gem and testing it to be severely unreliable so I decided to drop the fake specific unique implementation and rely on the real deal instead. |
@toadle are you sure you have required the actual gem before the test overrides? Seems like the gem has not been required. |
@mhenrixon I was pretty sure I had this wired correctly, but I'll try it again. Also: Isn't it possible to at least disable I'm with @jasonschock that the redis-dependency is also extremely difficult to cope with, when using a CI-server. In my case I had to completely get rid of |
@mhenrixon As @toadle mentions, I think just having an option to disable the gem when running tests would be a simple solution. I'm not super worried about testing uniqueness either, but I at least want to:
If I were someone worried about testing uniqueness, then I would probably be someone that would also go through the effort of running Docker or some such so as to have a real instance of Redis running. (That's not me.) Maybe a block helper, like Sidekiq uses?
|
Why don't you just remove the middleware when you are testing? I mean if
you really don't care then just remove the middleware.
|
Thanks Mikael for the awesome gem. I figured I'd contribute the exact code required, since we just hit this issue ourselves in our test environment: Sidekiq.configure_client do |config|
config.client_middleware do |chain|
chain.remove SidekiqUniqueJobs::Client::Middleware
end
end |
@pcai where exactly does your snippet go? I've tried on spec_helper but the error persists |
That snippet worked for me: WikiEducationFoundation/WikiEduDashboard@06b8e52 |
When I use any of the locks except
:while_executing
, I see this error when running tests:It seems to suddenly be expecting Redis to be running. I could just start Redis locally, but for my CI server it's a problem. Any idea why these options might break Sidekiq::Testing?
In test_helper.rb:
Worker:
Test:
The text was updated successfully, but these errors were encountered: