On Sat, Mar 30, 2013 at 10:20:12AM +0900, John Mettraux wrote:
>
> On Fri, Mar 29, 2013 at 09:09:20AM -0700, Adrien Kohlbecker wrote:
> >
> > I put this specific issue aside for the time being, but now I'm running
> > into another issue with storage, this time with HashStorage.
> > When I run the specs of ruote-resque using FsStorage, they pass. When I
> > change the storage to HashStorage, they fail.
> > I don't know if the two issues share the same root cause, but they seem
> > related.
> >
> > (...)
> >
> > If you would like to reproduce the issue, the spec is at
> > /spec/lib/ruote/resque/receiver_spec.rb
Salut Adrien,
I gave it a try and and it broke for me too, but it's nothing serious.
The first thing I noticed: in line 52 of the spec,
system('rm -rf spec/tmp/ruote_work')
is FsStorage specific. The better way to do it (works with all well-behaved
storage implementations):
@board.storage.purge!
The second thing: the receiver in the spec is instantiated and bound to
Resque but it's never shut down. When running the specs one by one they are
successful, when running them all, previous receivers fetch the work of the
current spec receiver... With FsStorage it looks alright, since the storage
is filesystem backed whatever ruote worker + fs storage pair picks up, it
ends up in the fs... With the HashStorage, the old receiver feeds the flunk
message to its old HashStorage whose Worker was carefully shut down by your
after(:each) block. The flunk msg just disappears...
You have to shut down the old receiver before the new spec interprets.
I hope it helps, meilleures salutations,