Skip to content
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

chore: Fix flaky IT test cases #8260

Merged
merged 24 commits into from
Sep 12, 2022
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9fb64e6
chore: Busy wait java-container CREATE operation to finish
lqiu96 Aug 31, 2022
c3edca8
chore: Delete any existing java-notebook instances
lqiu96 Aug 31, 2022
e6c548e
chore: Use ListInstanceRequest with parent
lqiu96 Aug 31, 2022
06d3f67
chore: Delete gapic compute instances
lqiu96 Sep 1, 2022
7ad0c30
chore: Use ZonedDateTime for RFC3339 with Zone
lqiu96 Sep 1, 2022
e77cefd
chore: Setup the correct Request object field
lqiu96 Sep 1, 2022
b466d5f
chore: Create new IT profile
lqiu96 Sep 1, 2022
704cd3c
chore: Move shared deps profile to root pom.xml
lqiu96 Sep 1, 2022
9c21c07
chore: Use test lifecycle phase for graalvm tests
lqiu96 Sep 1, 2022
056b2cd
chore: Use old pom configs
lqiu96 Sep 2, 2022
0ad9b28
chore: Use correct path to vision resources
lqiu96 Sep 2, 2022
06c618d
Merge branch 'main' into update_container_IT
lqiu96 Sep 2, 2022
c200945
chore: Remove unused pom.xml
lqiu96 Sep 6, 2022
3922ea7
chore: Move busy wait after CREATE operation
lqiu96 Sep 6, 2022
08a5645
chore: Add specific names for IT compute instances
lqiu96 Sep 6, 2022
7782c59
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 6, 2022
aaa73ba
chore: Clean up compute instances names
lqiu96 Sep 7, 2022
7ac0434
chore: Clean up instances
lqiu96 Sep 7, 2022
ad03253
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 7, 2022
2bfe213
chore: Add checks for deletion
lqiu96 Sep 8, 2022
24462f0
Merge branch 'update_container_IT' of github.com:googleapis/google-cl…
lqiu96 Sep 8, 2022
dd1bad5
chore: Add missing import
lqiu96 Sep 8, 2022
a99d4dd
chore: Add missing import for notebooks
lqiu96 Sep 8, 2022
b087f07
Merge branch 'main' into update_container_IT
lqiu96 Sep 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: Busy wait java-container CREATE operation to finish
  • Loading branch information
lqiu96 committed Aug 31, 2022
commit 9fb64e644eeefc7c958dedb6acc24f337ea85217
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
import com.google.container.v1.ListOperationsResponse;
import com.google.container.v1.NodePool;
import com.google.container.v1.Operation;
import com.google.container.v1.Operation.Status;
import com.google.container.v1.ServerConfig;
import java.util.List;
import java.util.UUID;
@@ -90,7 +91,14 @@ public static void beforeClass() throws Exception {

@AfterClass
public static void afterClass() throws Exception {
Thread.sleep(TimeUnit.MINUTES.toMillis(5));
Operation response = client.getOperation(PROJECT_ID, ZONE, operation.getName());
// Sleep for one minute until Cluster CREATE operation is complete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we waiting for cluster creation completion in afterClass()? Shouldn't we wait for it right after creation in beforeClass()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to run operations of the client (get/ list) without the operation having to be complete. It was only when deleting the cluster, I got an error with Operation in progress. I think it would make sense to move this to wait when the operation was run.

I'll change this to to do the busy wait in beforeClass().

while (response.getStatus() != Status.DONE) {
LOG.info(String.format("Cluster CREATE Operation Status: %s", response.getStatus()));
Thread.sleep(TimeUnit.MINUTES.toMillis(1));
response = client.getOperation(PROJECT_ID, ZONE, operation.getName());
}
// Thread.sleep(TimeUnit.MINUTES.toMillis(5));
client.deleteCluster(PROJECT_ID, ZONE, CLUSTER_NAME);
LOG.info(String.format("%s cluster deleted successfully.", CLUSTER_NAME));
client.close();