GoogleCloudPlatform / python-docs-samples

Code samples used on cloud.google.com
Apache License 2.0
7.46k stars 6.44k forks source link

healthcare.api-client.fhir.fhir_resources_test: test_conditional_delete_resource failed #3717

Closed flaky-bot[bot] closed 4 years ago

flaky-bot[bot] commented 4 years ago

This test failed!

To configure my behavior, see the Build Cop Bot documentation.

If I'm commenting on this issue too often, add the buildcop: quiet label and I will stop commenting.


commit: be55626e03b68fd9cb28a80200974b14988bed89 buildURL: Build Status, Sponge status: failed

Test output
Traceback (most recent call last):
  File "/tmpfs/src/github/python-docs-samples/healthcare/api-client/fhir/fhir_resources_test.py", line 290, in test_conditional_delete_resource
    fhir_store_id,
  File "/tmpfs/src/github/python-docs-samples/healthcare/api-client/fhir/fhir_resources.py", line 592, in conditional_delete_resource
    response.raise_for_status()
  File "/tmpfs/src/github/python-docs-samples/healthcare/api-client/fhir/.nox/py-3-6/lib/python3.6/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://healthcare.googleapis.com/v1beta1/projects/python-docs-samples-tests/locations/us-central1/datasets/test_dataset_46d8de10-d414-4163-88ea-c2b16f0ba6df/fhirStores/test_fhir_store-241a3302-9664-443d-9468-a8765b03cc86/fhir/Observation?status=cancelled
flaky-bot[bot] commented 4 years ago

Looks like this issue is flaky. :worried:

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (be55626e03b68fd9cb28a80200974b14988bed89), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

tmatsuo commented 4 years ago

I think I understand the cause of this.

The sample code fhir_resources.py uses wrong googleapiclient.errorsHttpError instead of requests.exceptions.HTTPError.

Anyways the sample code should not swallow the exception regardless.

Then, the test should retry on errors.