-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Harden TestClientWithRequestTimeout #39168
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
Harden TestClientWithRequestTimeout #39168
Conversation
f96f9dc to
0fdcb85
Compare
Codecov Report
@@ Coverage Diff @@
## master #39168 +/- ##
=========================================
Coverage ? 37.01%
=========================================
Files ? 612
Lines ? 45655
Branches ? 0
=========================================
Hits ? 16898
Misses ? 26468
Partials ? 2289 |
|
@jhowardmsft @cpuguy83 ptal |
pkg/plugins/client_test.go
Outdated
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.
Why not do something like, define the error interface locally:
type timeoutError interface {
Timeout() bool
}And type check against that?
|
Ping |
0fdcb85 to
35fd1e1
Compare
|
@cpuguy83 Updated; hope this is what you meant 🤗 |
|
Not quite, I was thinking a single assertion to a timeout error since they all should implement that. |
|
Ahm, right. I wasn't sure if it was part of the contract for these errors (I saw the |
35fd1e1 to
0b1fbdd
Compare
DeadlineExceeded now implements a TimeOut() function, since golang/go@dc4427f Check for this interface, to prevent possibly incorrect failures; ``` 00:16:41 --- FAIL: TestClientWithRequestTimeout (0.00s) 00:16:41 client_test.go:259: assertion failed: 00:16:41 --- context.DeadlineExceeded 00:16:41 +++ err 00:16:41 : 00:16:41 -: context.deadlineExceededError{} 00:16:41 +: &net.OpError{Op: "dial", Net: "tcp", Addr: s"127.0.0.1:49294", Err: &poll.TimeoutError{}} 00:16:41 ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
0b1fbdd to
c7816c5
Compare
|
Test passed; |
cpuguy83
left a comment
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.
LGTM
|
LGTM |
splitting this off from #39100 per discussion on #39100 (comment)
addresses #38587 (first reported failure)
DeadlineExceeded now implements a TimeOut() function,
since golang/go@dc4427f
Check for this as well, to prevent possibly incorrect failures;
- How to verify it