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

test_write_and_bulk_delete in the google_cloud_storage_test_suite fails consistently after first run #5398

Open
mattsre opened this issue Sep 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mattsre
Copy link

mattsre commented Sep 7, 2024

Describe the bug
After running make test-all once without tearing down the Docker containers, future runs of make test-all consistently fail on the google_cloud_storage_test_suite, specifically on the write_and_bulk_delete test.

Caused by:
    0: storage error(kind=Io, source=Unexpected (temporary) at Writer::close, context: { uri: http://127.0.0.1:4443/upload/storage/v1/b/sample-bucket/o?uploadType=media&name=foo, response: Parts { status: 500, version: HTTP/1.1, headers: {"content-type": "application/json", "date": "Fri, 06 Sep 2024 23:34:15 GMT", "content-length": "124"} }, service: gcs, path: foo } => {"error":{"code":500,"message":"rename /tmp/.foo319022535277020113 /storage/sample-bucket/foo: file exists","errors":null}}
       )
    1: Unexpected (temporary) at Writer::close, context: { uri: http://127.0.0.1:4443/upload/storage/v1/b/sample-bucket/o?uploadType=media&name=foo, response: Parts { status: 500, version: HTTP/1.1, headers: {"content-type": "application/json", "date": "Fri, 06 Sep 2024 23:34:15 GMT", "content-length": "124"} }, service: gcs, path: foo } => {"error":{"code":500,"message":"rename /tmp/.foo319022535277020113 /storage/sample-bucket/foo: file exists","errors":null}}

The fake GCS server logs some 404/500 responses:

2024-09-06 22:42:02 time=2024-09-07T02:42:02.055Z level=INFO msg="172.16.7.1 - - [07/Sep/2024:02:42:02 +0000] \"GET /storage/v1/b/sample-bucket/o/write_and_delete HTTP/1.1\" 200 470\n"
2024-09-06 22:42:02 time=2024-09-07T02:42:02.057Z level=INFO msg="172.16.7.1 - - [07/Sep/2024:02:42:02 +0000] \"DELETE /storage/v1/b/sample-bucket/o/write_and_delete HTTP/1.1\" 200 5\n"
2024-09-06 22:42:02 time=2024-09-07T02:42:02.060Z level=INFO msg="172.16.7.1 - - [07/Sep/2024:02:42:02 +0000] \"GET /storage/v1/b/sample-bucket/o/write_and_delete HTTP/1.1\" 404 59\n"
2024-09-06 22:42:02 time=2024-09-07T02:42:02.062Z level=INFO msg="172.16.7.1 - - [07/Sep/2024:02:42:02 +0000] \"DELETE /storage/v1/b/sample-bucket/o/write_and_delete HTTP/1.1\" 404 59\n"
2024-09-06 22:42:02 time=2024-09-07T02:42:02.073Z level=INFO msg="172.16.7.1 - - [07/Sep/2024:02:42:02 +0000] \"POST /upload/storage/v1/b/sample-bucket/o?uploadType=media&name=foo HTTP/1.1\" 500 125\n"

Steps to reproduce (if applicable)
Steps to reproduce the behavior:

  1. Clone repo and run make test-all, expect all tests to pass the first time
  2. Run make test-all again, expect test_write_and_bulk_delete to fail

Expected behavior
Expect tests to not change from passing to failing without any code changes. It seems maybe some data from previous runs is left behind in the fake GCS server and causes future runs to fail?

Configuration:

> git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

> git rev-parse --short HEAD
79acfe40
@mattsre mattsre added the bug Something isn't working label Sep 7, 2024
@mattsre mattsre changed the title test_write_and_bulk_delete in the google_cloud_storage_test_suite is fails consistently after first run test_write_and_bulk_delete in the google_cloud_storage_test_suite fails consistently after first run Sep 7, 2024
@rdettai
Copy link
Contributor

rdettai commented Sep 8, 2024

As a workaround, you can run make docker-compose-down between each test run. More convenient:

make -k test-all docker-compose-down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants