alphasights / sneakers_handlers

Retries with exponential backoff for sneakers
MIT License
33 stars 11 forks source link

Functional tests #4

Closed brianstorti closed 8 years ago

brianstorti commented 8 years ago

Here's a suggestion for how we could have an end-to-end tests for these handlers:

This is just a proof of concept, ideally we'd have workers to test timeouts, errors, etc.

What do you think? @abepetrillo @jjbohn

jjbohn commented 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 sleeping while still being a pretty true end to end test.

brianstorti commented 8 years ago

@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.

abepetrillo commented 8 years ago

Yea I was, taking a look at this now.

abepetrillo commented 8 years ago

Will try and adopt this in my PR for the retry worker. This is a great help!

jjbohn commented 8 years ago

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

brianstorti commented 8 years ago

@jjbohn yeah, I mean for this second sleep, after we publish a message. The first one we can get rid of.

abepetrillo commented 8 years ago

@brianstorti Attempted to use the workers.run suggestion without success, I think we need the fork and sleep as suggested.

brianstorti commented 8 years ago

@abepetrillo this seems to be working fine for me. Did you try something different?

abepetrillo commented 8 years ago

:+1: