Repository navigation
Conversation
Add compute/cloud-client/src/test/java/compute/WaitForOperationIT.java covering the Compute Engine WaitForOperation sample: - Waiting for an in-progress zonal disk creation operation to reach DONE - Handling an operation that is already in Status.DONE - Verifying NotFoundException is thrown for a non-existent operation Uses an AutoCloseable TempZonalDisk fixture with try-with-resources to isolate and clean up temporary disks per test, and documents required environment variables in class Javadoc.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces integration tests for the WaitForOperation class in WaitForOperationIT.java, using a temporary zonal disk helper (TempZonalDisk) to manage resource creation and cleanup. The feedback highlights a potential resource leak in the close() method of TempZonalDisk: if waitUntilDone() throws an exception, the subsequent disk deletion is skipped. It is recommended to wrap waitUntilDone() in a try-finally block to ensure cleanup always executes.
…tionIT cases Address code review feedback on WaitForOperationIT: - Bound TempZonalDisk cleanup polling with a 3-minute deadline and 1s backoff, make initialOperation immutable, and ensure disk deletion still runs if waiting fails while preserving suppressed exceptions and thread interrupt status - Use a synthetic non-existent Status.DONE Operation in testWaitForOperationAlreadyDone to avoid provisioning a live disk and fail with NotFoundException if WaitForOperation ever re-waits - Explicitly set Status.RUNNING on the invalid Operation test case
Contributor
Author
|
Please note that failures on the pipeline are unrelated to these changes, they will be addressed on a different task b/590601059. |
angelcaamal
approved these changes
Nov 26, 2026
angelcaamal
left a comment
Contributor
There was a problem hiding this comment.
Since the errors will be fixed, LGTM!
XrossFox
marked this pull request as ready for review
November 26, 2026 16:39
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.
Description
Add compute/cloud-client/src/test/java/compute/WaitForOperationIT.java covering the Compute Engine WaitForOperation sample:
Fixes b/585606810
Checklist
Testing
mvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory onlyCompliance & Style
pom.xmlparent set to latestshared-configurationPost-Approval Actions