Skip to content

add check for existing cluster #9784

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

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion dataproc/snippets/submit_job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import uuid

import backoff
from google.api_core.exceptions import (InternalServerError, NotFound,
from google.api_core.exceptions import (AlreadyExists, InternalServerError, NotFound,
ServiceUnavailable)
from google.cloud import dataproc_v1 as dataproc
import pytest
Expand Down Expand Up @@ -78,6 +78,9 @@ def cluster_name(cluster_client):
try:
setup_cluster(cluster_client, curr_cluster_name)
yield curr_cluster_name
except AlreadyExists: # 409 can happen when we backoff on service errors during submission
print("Already exists, skipping cluster creation")
yield curr_cluster_name
finally:
teardown_cluster(cluster_client, curr_cluster_name)

Expand Down