xdsclient/e2e_test: use SendContext() where appropriate #5729
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.
This got missed in the previous PR somehow. We need to use
SendContext()
instead ofSend()
in cases where we expect the resource be NACK'ed because in these cases the management server will continuously keep resending the same resource again and again. UsingSendContext()
in the watch callback ensures that the send operation gets unblocked when the context is cancelled as part of test termination. If we useSend()
instead, this could sometimes lead to a leaked goroutine as the watch callback is blocked on the send operation.FWIW, this is already done in the
lds_watchers_test.go
which is merged.RELEASE NOTES: n/a