jarcoal/httpmock

Nested handler causing deadlock

elliotchance opened this issue · 4 comments

I ran into an issue where I had mocked two servers and one of the handlers was called from within the another mocked handler. Not on purpose, but the test hung indefinitely. I found out it's because there is a mutex around the handler internally so this lead to a deadlock.

I'm sorry I don't have a code snippet because I had to do some major refactoring and ended up removing httpmock for my test to work around this issue. I wanted to add the issue here before I forgot.

Hi, do you use the v1 branch and at least the v1.0.1 release?

gopkg.in/jarcoal/httpmock.v1 v1.0.0-20190204112747-618f46f3f0c8

So I cannot confirm if it's still an issue.

I think v1.0.1 fixes your problem, because earlier versions have known locking problems that should be gone now.

Feel free to re-enable your httpmock tests with the last release, and tell us.

Thanks. I'm going to close this until I have had a code snippet that reproduces the issue.