to_rack and have_requested #327

Closed
benhamill opened this Issue Nov 4, 2013 · 4 comments

Comments

Projects
None yet
2 participants

I'm converting some of my WebMock stubs to use a simple Sinatra app instead of re-stubbing requests over and over. I still, however, want to make assertions about certain requests my code will make. I'm using wemock/rspec.

Currently, however, when I invoke the have_requested matcher, it hangs forever. I've tracked it down to the attempt to access WebMock::RequestRegistry.instance.requested_signatures. If I make an empty spec (with a before that makes the requests under test) and then drop a binding.pry in there, I can ask for the signatures and it just goes forever. If I let it run for a while, the fan on my laptop spins up and Ruby dominates top.

Any ideas on how I can track this down? Do these features just not play nicely together? I'd be happy to work out a fix, but don't really know where to start.

Owner

bblimke commented Nov 4, 2013

Hi Ben,

any chance it's due to pry?

How do you run Sinatra? as a separate Ruby process?

I can't really help without having a spec or a sample code to run locally.

I'm almost certain it's not to do with pry (I was using pry to figure out
why the test was hanging). I'll try to narrow down a minimum repro gist. I
just wanted to confirm that these features were meant to play nicely
together before I went investigating deeply.

On Mon, Nov 4, 2013 at 3:06 PM, Bartosz Blimke notifications@github.comwrote:

Hi Ben,

any chance it's due to pry?

How do you run Sinatra? as a separate Ruby process?

I can't really help without having a spec or a sample code to run locally.


Reply to this email directly or view it on GitHubhttps://github.com/bblimke/webmock/issues/327#issuecomment-27722596
.

In trying to make a minimal repro, I'm failing, but in my project, it's still hanging. I'm using the to_rack method to run Sinatra in a manner similar to this: https://gist.github.com/benhamill/7275642.

However, both in trying to do a minimal repro and trying to spin up a new rails app to be less minimal, I can't reproduce the hang. So it's clearly some conflicting thing in my code base. I have no idea how to determine what, though.

I think it's some bug in Hyperclient (the HAL client I'm using). I think I'm going to be not using it soon because it's been causing frustration in other areas, too.

benhamill closed this Nov 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment