Merged
Conversation
Member
Author
|
TODO: add some unit tests -> Done |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #283 +/- ##
==========================================
+ Coverage 82.27% 82.74% +0.47%
==========================================
Files 45 45
Lines 3447 3454 +7
==========================================
+ Hits 2836 2858 +22
+ Misses 499 489 -10
+ Partials 112 107 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* fixes go-openapi#126 This PR implements the proposal N°1 exposed in issue go-openapi#126: * if there is a non-zero timeout set with the request, we add this timeout to the operation context * applicable contexts are: runtime.Context -> operation.Context -> context.WithTimeout(t>0) * the actual behavior is determined by the shortest deadline set on those contexts * added unit tests to assert that the different contexts are formed correctly: * an operation with no context inherits from the runtime context * an operation with no timeout set (by context or parameter) defaults to 30s (default timeout) * when several timeouts are set, the shortest wins * an operation with no timeout in context and a 0 timeout param waits for ever (and not with immediate timeout) Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
b81b10f to
d337653
Compare
youyuanwu
approved these changes
Dec 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixed immediate timeout
This PR implements the proposal N°1 exposed in issue #126:
if there is a non-zero timeout set with the request, we
add this timeout to the operation context
applicable contexts are:
runtime.Context -> operation.Context -> context.WithTimeout(t>0)
the actual behavior is determined by the shortest deadline set for those
contexts
added unit tests to assert that the different contexts are formed
correctly:
for ever (and not with immediate timeout)
Signed-off-by: Frédéric BIDON fredbi@yahoo.com