bmc-toolbox / bmclib

Library to abstract Baseboard Management Controller interaction
Apache License 2.0
194 stars 37 forks source link

Add timeouts everywhere #313

Closed jacobweinstock closed 1 year ago

jacobweinstock commented 1 year ago

What does this PR implement/change/remove?

This expands the timeout for opening connections to all method/BMC interactions.

If a context with a timeout IS provided to a method call but no per provider timeout is defined, then we default to a timeout of the provided timeout duration divided by the number of providers/drivers in the Client.Registry.Drivers slice.

If a context with a timeout IS NOT provided to a method call and no per provider timeout is defined, then we use the defaultConnectTimeout of 30 seconds.

Checklist

The HW vendor this change applies to (if applicable)

The HW model number, product name this change applies to (if applicable)

The BMC firmware and/or BIOS versions that this change applies to (if applicable)

What version of tooling - vendor specific or opensource does this change depend on (if applicable)

Description for changelog/release notes

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 80.48% and project coverage change: +0.06 :tada:

Comparison is base (4d46ab2) 43.52% compared to head (d034c23) 43.59%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #313 +/- ## ========================================== + Coverage 43.52% 43.59% +0.06% ========================================== Files 35 35 Lines 2711 2725 +14 ========================================== + Hits 1180 1188 +8 - Misses 1410 1415 +5 - Partials 121 122 +1 ``` | [Impacted Files](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox) | Coverage Δ | | |---|---|---| | [client.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Y2xpZW50Lmdv) | `28.87% <40.00%> (+2.51%)` | :arrow_up: | | [bmc/connection.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL2Nvbm5lY3Rpb24uZ28=) | `91.80% <75.00%> (-0.27%)` | :arrow_down: | | [bmc/boot\_device.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL2Jvb3RfZGV2aWNlLmdv) | `94.59% <100.00%> (+0.15%)` | :arrow_up: | | [bmc/firmware.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL2Zpcm13YXJlLmdv) | `94.87% <100.00%> (-0.13%)` | :arrow_down: | | [bmc/inventory.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL2ludmVudG9yeS5nbw==) | `94.87% <100.00%> (-0.13%)` | :arrow_down: | | [bmc/postcode.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL3Bvc3Rjb2RlLmdv) | `94.87% <100.00%> (-0.13%)` | :arrow_down: | | [bmc/power.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL3Bvd2VyLmdv) | `94.28% <100.00%> (+0.16%)` | :arrow_up: | | [bmc/reset.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL3Jlc2V0Lmdv) | `94.59% <100.00%> (+0.15%)` | :arrow_up: | | [bmc/user.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL3VzZXIuZ28=) | `94.48% <100.00%> (+0.15%)` | :arrow_up: | | [bmc/virtual\_media.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/313?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-Ym1jL3ZpcnR1YWxfbWVkaWEuZ28=) | `94.28% <100.00%> (-0.16%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

joelrebel commented 1 year ago

@jacobweinstock I'll let this merge in for now and the README update can be a separate PR.