Add testing functionality for WaitExecution#393
Open
bergsieker wants to merge 3 commits intobazelbuild:masterfrom
Open
Add testing functionality for WaitExecution#393bergsieker wants to merge 3 commits intobazelbuild:masterfrom
bergsieker wants to merge 3 commits intobazelbuild:masterfrom
Conversation
Retrying based on an operation error is always incorrect, although mostly harmless. Once an operation has an error, it is marked as Done and should never be unmarked, so retries will simply fetch the same operation (with the same error) again.
The existing ExecuteAndWait function will rarely actually call WaitExecution when used against a live server. This change adds the ability to terminate the Execute call early and switch to WaitExecution immediately so that it's possible for service implementors to test WaitExecution.
bozydarsz
reviewed
Dec 29, 2021
| } | ||
| } | ||
| if returnEarly { | ||
| return status.Error(codes.Internal, "fake error to for wait call") |
Collaborator
There was a problem hiding this comment.
nit: "(...) error to for wait (...)", shouldn't it be, "(...) error to trigger the wait (...)"
rubensf
reviewed
Jan 5, 2022
| // ForceEarlyWaitCalls specifies whether ExecuteAndWait should call WaitExecution immedately | ||
| // after receiving an Operation from Execute. It is primarily useful for testing | ||
| // WaitExecution. | ||
| ForceEarlyWaitCalls bool |
Contributor
There was a problem hiding this comment.
I'm not inheretly opposed to this... But I think the most appropriate place for this behavior would be on the fake server: https://github.com/bazelbuild/remote-apis-sdks/blob/af1232ee0d79920ab8390fb855f95dca18a69cf0/go/pkg/fakes/exec.go. Wdyt?
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.
The existing ExecuteAndWait function will rarely actually call
WaitExecution when used against a live server. This change adds the
ability to terminate the Execute call early and switch to WaitExecution
immediately so that it's possible for service implementors to test
WaitExecution.