Closed krainboltgreene closed 6 years ago
I can definitely supply more information if needed.
If I specify certain contexts, via line specification, I don't get this issue. Currently I'm "bisect"ing my way though this, apparently there's a specific test that's doing this.
I've removed two comments because they were false alarms.
Okay, I've tracked it down to this:
At the top level of this test I have this:
before do
post "/api/v1/users/two_factor_auth", JSON.dump(body), default_headers.merge(headers)
end
If I binding.pry
inside that, before the post, and I manually call it:
29: end
30: end
31:
32: before do
33: binding.pry
=> 34: post "/api/v1/users/two_factor_auth", JSON.dump(body), default_headers.merge(headers)
35: end
36:
37: context "with a user that has no phone" do
38: let(:user) { create(:user, phone: nil) }
39:
(test) #<RSpec::ExampleGroups::V1Users::TwoFactorAuth::WhenTheUserAlreadyHasAUnverifiedNumber::SupplyingABadPhoneNumber:0x00007fe893b9b378>:0> post "/api/v1/users/two_factor_auth", JSON.dump(body), default_headers.merge(headers)
And the pry session exits with code 0.
There's zero loglines generated from that expression in my rails test.log, so that leaves me to believe the problem lies inside rpsec's scope of things.
I noticed you're running rspec
via spring
. Can you try without spring? Historically, spring has been the source of many, many odd behaviors folks see when using it to run RSpec.
Also, can you grep your codebase (and your gems, if possible) to see if any of them might be calling exit
anywhere?
Historically, spring has been the source of many, many odd behaviors folks see when using it to run RSpec.
I should have known. I'm no fan, anyways this is what spring was hiding:
SystemStackError:
stack level too deep
# ./spec/requests/api/v1/users_request_spec.rb:385:in `block (5 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:264:in `block (4 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:385:in `block (5 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:264:in `block (4 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:385:in `block (5 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:264:in `block (4 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:385:in `block (5 levels) in <top (required)>'
# ./spec/requests/api/v1/users_request_spec.rb:264:in `block (4 levels) in <top (required)>'
I can handl it from here.
9 times out of 10 this kind of error is because I have a recursive application code level problem, not necessarily in the spec suite. Just a heads up for future lookers.
Versions:
Output: