Xuanwo opened a new pull request, #8726:
URL: https://github.com/apache/opendal/pull/8726

   # Which issue does this PR close?
   
   Refs #8134.
   
   This PR does not close the tracking issue; it adds the missing real-backend 
behavior coverage for `Writer::copy_from` source-condition failure and 
`abort()` target preservation on the S3 native path.
   
   # Rationale for this change
   
   The `Writer::copy_from` API landed in #8140 with an interleaving behavior 
test, but no real-backend coverage for a rejected source condition or for 
aborting the failed writer. The only abort coverage lived in mock tests in 
`core/core/src/layers/complete.rs`. Issue #8134's acceptance checklist asks for 
`close`, `abort`, and condition failures to be verified against the actual 
service.
   
   # What changes are included in this PR?
   
   - Adds `test_writer_copy_from_mismatched_if_match_preserves_target` to 
`core/tests/behavior/async_write.rs`, gated on `write_can_multi`, 
`write_can_copy_from`, and `read_with_if_match`.
   - The test seeds a target object with known content and a 5 MiB source, 
opens a writer with an exact 5 MiB chunk and `concurrent(2)` so the copy is 
scheduled as a native part (`UploadPartCopy` on S3), and calls 
`copy_from_options` with a mismatched source `if_match`.
   - It asserts `ErrorKind::ConditionNotMatch` surfaces either at `copy_from` 
or at `close`, then calls `abort()` and verifies the target still reads the 
original content.
   
   Verified locally against the repo's pinned containers on this branch:
   
   - SeaweedFS (`fixtures/s3/docker-compose-seaweedfs.yml`, image 
`chrislusf/seaweedfs:4.52`): all `test_writer*` behavior tests pass (17/17). 
The mismatched `if_match` surfaces `ConditionNotMatch` at `close()` after the 
scheduled `UploadPartCopy` part returns 412.
   - Silo S3 (`fixtures/s3/docker-compose-silo.yml`, the S3 fixture run in PR 
CI): all `test_writer*` behavior tests pass (17/17), same error timing.
   - `cargo clippy --tests --features tests,services-s3 -- -D warnings` and 
`cargo fmt --all -- --check` are clean.
   - `TEST_FIXTURE` cleanup confirmed; no leftover objects in the test bucket.
   
   No service or core changes were needed: the real-backend run confirmed S3 
already propagates the source-condition failure and that `abort()` discards the 
multipart upload without touching the target.
   
   # Are there any user-facing changes?
   
   No. Test-only change.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: T3 Code (Pi coding agent), full-access runtime
   - Model: devin/swe-2
   - Effort: max
   - Role: Authored the behavior test, ran it against the pinned SeaweedFS and 
Silo S3 containers locally, and prepared this PR. The verification results 
above were produced by the actual `cargo test` runs described.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to