Skip to content

test_interrupted_creation[True-append] failed once in CI without aborting the upload #1099

Description

@laughingman7743

Problem

tests/pyathena/filesystem/test_s3.py::TestS3File::test_interrupted_creation[True-append] failed once in CI:

  • Run: https://github.com/pyathena-dev/PyAthena/actions/runs/37217440036 (attempt 1, test / run (3.14), Linux, Python 3.14.7)
  • Commit: e12d5d58 (PR Move the bucket versioning request into S3Core #1098). That PR does not touch S3File or the writer path that this test exercises.
  • Failure: AssertionError: Expected '_call' to be called once. Called 0 times. The assertion is the abort of the recovered multipart upload, at test_s3.py:6157.
  • No log was captured. In particular, the Failed to abort multipart upload error that _close_without_commit() logs when the abort fails did not appear. So the abort was not attempted, rather than attempted and failed.

The test was added in #1085 (#1077). It sends SIGINT to the main thread while S3File._initiate_upload() waits for CreateMultipartUpload on the executor. It then checks that the creation is waited for and the upload aborted before the interrupt is re-raised.

Reproduction

Not reproduced locally (macOS, Python 3.13.1): 0 failures in 120 runs of the 10 parametrized cases, while the offline filesystem suite ran in parallel for load. The other 9 cases and all other CI runs of this test have passed.

Expected

The test passes deterministically. Either the test's signal timing is fixed, or a real window in _initiate_upload() / _close_without_commit() is fixed in which an interrupt leaves the created upload without an abort.

Proposed investigation

  • Determine where the KeyboardInterrupt surfaced in the failing schedule. In particular, check whether it can be raised outside the try in _initiate_upload(), or before creation is assigned, so that _close_without_commit() runs with creation=None and finds no upload.
  • Try to reproduce on Linux with Python 3.14 under load, for example in a container.
  • If the window is real, fix the code, which would be a An interrupted S3File write leaves the upload behind when CreateMultipartUpload is in flight #1077 follow-up. If only the test's synchronization is wrong, fix the test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions