Closed brianstorti closed 8 years ago
Nice. @abepetrillo were you working on something like this too?
@brianstorti do you think we need to actually spin up the actual runner? Would calling Sneakers::Worker#run
work well enough? I think that would avoid any timing issues we might get into with sleep
ing while still being a pretty true end to end test.
@jjbohn yeah, good point, I think that using Sneaker::Worker#run
is enough. But I don't think we'll be able to get rid of that sleep
after we publish a message with Bunny
, though.
Yea I was, taking a look at this now.
Will try and adopt this in my PR for the retry worker. This is a great help!
No problem. I think Worker#run
just calls subscribe on the bunny
connection once, so it won't create persistent runner or anything so sleep
shouldn't be necessary.
On Mon, Apr 11, 2016 at 8:56 AM Abraham Petrillo notifications@github.com wrote:
Will try and adopt this in my PR for the retry worker. This is a great help!
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/alphasights/sneakers_handlers/pull/4#issuecomment-208327664
@jjbohn yeah, I mean for this second sleep, after we publish a message. The first one we can get rid of.
@brianstorti Attempted to use the workers.run
suggestion without success, I think we need the fork and sleep as suggested.
@abepetrillo this seems to be working fine for me. Did you try something different?
:+1:
Here's a suggestion for how we could have an end-to-end tests for these handlers:
sneakers_handlers
tests queues;Sneakers
workers (in this case, 2 workers using theDeadLetter
handler, one that succeeds and another that fails, both bound to the same routing key)Bunny
to send a couple of messages to this exchange;This is just a proof of concept, ideally we'd have workers to test timeouts, errors, etc.
What do you think? @abepetrillo @jjbohn