Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce timeouts in Faraday's test adapter #1465

Merged
merged 2 commits into from
Dec 9, 2022

Conversation

dpep
Copy link
Contributor

@dpep dpep commented Dec 6, 2022

Description

Upgrade faraday's test adapter to enforce connection timeouts. Inspired by the faraday-rack implementation.

@@ -78,8 +78,7 @@ def save_response(env, status, body, headers = nil, reason_phrase = nil, finishe
# @param type [Symbol] Describes which timeout setting to get: :read,
# :write, or :open.
# @param options [Hash] Hash containing Symbol keys like :timeout,
# :read_timeout, :write_timeout, :open_timeout, or
# :timeout
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dedup :timeout which is also on line 80

@olleolleolle
Copy link
Member

(This is a super-cool PR, @dpep, the tests run after linting passes.)

Offenses:

lib/faraday/adapter/test.rb:283:11: C: [Correctable] Layout/IndentationWidth: Use 2 (not -7) spaces for indentation. ([https://rubystyle.guide#spaces-indentation](https://rubystyle.guide/#spaces-indentation))
          [env, meta].take(block_arity)
          ^^^^^^^
lib/faraday/adapter/test.rb:284:9: C: [Correctable] Layout/ElseAlignment: Align else with if.
        else
        ^^^^
lib/faraday/adapter/test.rb:286:9: W: [Correctable] Layout/EndAlignment: end at 286, 8 is not aligned with if at 282, 17.
        end
        ^^^
lib/faraday/adapter/test.rb:300:1: C: [Correctable] Layout/EmptyLines: Extra blank line detected. ([https://rubystyle.guide#two-or-more-empty-lines](https://rubystyle.guide/#two-or-more-empty-lines))

75 files inspected, 4 offenses detected, 4 offenses autocorrectable
Error: Process completed with exit code 1.
Linting complaints

@olleolleolle olleolleolle changed the title test adapter timeout Enforce timeouts in Faraday's test adapter Dec 9, 2022
Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thank you, @dpep!

@olleolleolle olleolleolle merged commit 9a16831 into lostisland:main Dec 9, 2022
@dpep dpep deleted the test-adapter-timeout branch December 9, 2022 16:07
@tilo
Copy link

tilo commented Dec 9, 2022

good work, @dpep! :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants