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

http resource: supply max-time option using read_timeout and open_timeout #2289

Merged
merged 1 commit into from
Nov 9, 2017

Conversation

bdellegrazie
Copy link
Contributor

Curl doesn't distinguish between them so need to use the sum of both as
the overall timeout.

fixes #2288

@bdellegrazie bdellegrazie requested a review from a team as a code owner November 6, 2017 12:24
Copy link
Contributor

@adamleff adamleff left a comment

Choose a reason for hiding this comment

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

@bdellegrazie thanks for your first PR to InSpec! Great contribution!

Unfortunately, you have some test failures. The curl commands get mocked by our MockLoader so we can test the resource end-to-end, and they use exact matches against the command. Because your PR changed the command, the mocks are no longer valid. You can find the mocks configured here:

https://github.com/chef/inspec/blob/master/test/helper.rb#L455-L466

Essentially, you need to add your new flag so the commands are properly mocked and then you should be fine.

You can run the tests manually on your workstation like so:

  • bundle install
  • bundle exec m test/unit/resources/http_test.rb

If you run the above BEFORE you fix the mocks, you should see errors indicating "command not mocked" that will give you more clues.

@bdellegrazie
Copy link
Contributor Author

@adamleff certainly, will do.

…eout

Curl doesn't distinguish between them so need to use the sum of both as
the overall timeout.

fixes inspec#2288

Signed-off-by: Brett Delle Grazie <brett.dellegrazie@gmail.com>
@bdellegrazie
Copy link
Contributor Author

@adamleff updated, please re-review at your earliest convenience, thanks!

@adamleff adamleff added the Type: Enhancement Improves an existing feature label Nov 8, 2017
Copy link
Contributor

@adamleff adamleff left a comment

Choose a reason for hiding this comment

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

Super job, @bdellegrazie - thanks for your contribution!

Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Great work @bdellegrazie Thank you very much.

@chris-rock chris-rock merged commit 0bb318c into inspec:master Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http resource doesn't obey read_timeout
3 participants