Beware of sidekiq-middleware

Perhaps this is just a rant but perhaps someone may find it useful some other day

I’ve been using sidekiq-middleware for keeping certain jobs unique. However, since perhaps several days ago, some of my tests started failing. And what’s worse was occasionally some of these tests actually would pass.

One thing I found was perform_async never added any jobs, (by looking at Worker.jobs.size). So after hours of pulling my hair out and mocking and stubbing essentially everything and to no avail, I tried the random thing of removing sidekiq-middleware from my gemfile, and suddenly everything worked. This sucks!

So question for my fellow thoughtbotters, what could I have done to prevent losing so much time on this?

So question for my fellow thoughtbotters, what could I have done to prevent losing so much time on this?

I can’t offer any specific advice as I’m not familiar with sidekiq middleware or what you were attempting to do with, but it sounds like attaching a debugger might have helped. Are you familiar with pry-nav or pry-debugger?

Great! Thanks. I will look into using Pry next time.