-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix stackprof not installed error #547
Fix stackprof not installed error #547
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #547 +/- ##
===========================================
- Coverage 87.39% 26.82% -60.57%
===========================================
Files 18 14 -4
Lines 1269 697 -572
===========================================
- Hits 1109 187 -922
- Misses 160 510 +350 see 17 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Looks like CI errors are due to change in behaviour from the redis client. There's a fix on #543 to get CI green. |
spec/lib/profiler_spec.rb
Outdated
|
||
expect(100..599).to include(status) | ||
expect(headers.keys).to(all(be_a(String))) | ||
expect(body).to(all(be_a(String))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than check for an Enumerable of Strings, lets do the Rack-spec thing and check for response to each?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. This caught a bug in the memory profiler spec, so thanks for that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spec change and I think it's G2G
8a1285c
to
641495b
Compare
Needs a rebase and then we're set. |
Fixes malformed response when pp=flamegraph is used and stackprof is not installed. Also forwards headers and status code from app response error cases so that app logs are consistent with what is actually returned by middleware.
641495b
to
9f5a083
Compare
Fixes malformed response when
pp=flamegraph
is used and stackprof is not installed (this happens on web servers such as puma due to the expectation that the body is an array, it crashes here: https://github.com/puma/puma/blob/d8765e362dd9b273635facefa0911252abdb584b/lib/puma/request.rb#L153).Also forwards headers and status code from app response error cases so that app logs are consistent with what is actually returned by middleware.
I couldn't test this through integration tests, so I had to use units. If we don't see value in the well-formed response tests, I can remove them.