Skip to content

Commit

Permalink
ci: harden schema sample teardown against 500 InternalServiceError (#519
Browse files Browse the repository at this point in the history
)

Closes #388.
  • Loading branch information
tseaver committed Oct 8, 2021
1 parent 782504f commit 5224c46
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions samples/snippets/schema_test.py
Expand Up @@ -20,9 +20,12 @@

from _pytest.capture import CaptureFixture
from flaky import flaky
from google.api_core.exceptions import InternalServerError
from google.api_core.exceptions import NotFound
from google.cloud import pubsub_v1
from google.cloud.pubsub import PublisherClient, SchemaServiceClient, SubscriberClient
from google.cloud.pubsub import PublisherClient
from google.cloud.pubsub import SchemaServiceClient
from google.cloud.pubsub import SubscriberClient
from google.pubsub_v1.types import Encoding
import pytest

Expand Down Expand Up @@ -59,7 +62,7 @@ def avro_schema(

try:
schema_client.delete_schema(request={"name": avro_schema_path})
except NotFound:
except (NotFound, InternalServerError):
pass


Expand All @@ -73,7 +76,7 @@ def proto_schema(

try:
schema_client.delete_schema(request={"name": proto_schema_path})
except NotFound:
except (NotFound, InternalServerError):
pass


Expand Down

0 comments on commit 5224c46

Please sign in to comment.