Repository navigation
test(s2test): Check that a Sub describes an object as its parent does - #474
Merged
Merged
Conversation
mojatter
force-pushed
the
test/sub-consistency
branch
from
October 27, 2026 07:36
14e0c8c to
a764ec6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#291 fixed
fsso that the root, aSubof it and aDirFSopened on the same directory answer the same ETag, Content-Type and metadata for an object, whichever of them wrote it. Neither theStorage.Subgodoc nor docs/backends.md stated that property, and only anfs-only, memfs-only test covered root andSub. This pins it in the conformance suite and the docs so the next layout change cannot silently undo it.Closes #299
Affects: Storage implementers (contract and
s2test).Changes
s2test.TestStorageSubConsistency(ctx, strg): writess2test-sub/a.txtthrough the root andb.txtthroughSub("s2test-sub"), each with a Content-Type and metadata, and requires the other view to answer the same ETag,ContentType()andMetadata(). It then runsPutMetadatathrough the view that did not write the object and reads it back through the one that did, requires a non-recursiveListof both views to agree on the ETags, and checks that aDeletethrough one view makesExistsfalse through the other. It writes only under its own prefixs2test-sub/and removes that prefix when done. Metadata must agree between the views and hold the keys the helper set; a backend's own extra keys are allowed.fs,s3,gcsandazblobcall it besideTestStorageNameEscape:fson memfs and an osfs temp root, the others with and without a root prefix.fsTestMetaSharedAcrossViewsgains fourDirFSrows (DirFS ↔ root, DirFS ↔ Sub) on osfs, sinceDirFSis not reachable through the interface.Storage.Subgodoc: aSubis a view of the prefix; an object written through either is the same object, with the same ETag, Content-Type and metadata, through the other..metareserved at every depth, temp files, what blocks a write withfs.ErrMetaBlocked). The paragraphs about pre-v0.20.0 and pre-v0.18.1 roots move unchanged under "Metadata files written before v0.20.0", which Track compatibility shims to remove in v1.0.0 #247 can delete as a whole.Upgrading notes for the release
Subto be a view of its parent, not a copy. A backend whoseSubanswers a different ETag, Content-Type or metadata than its parent, or does not see the parent's writes and deletes, failss2test.TestStorageSubConsistency.Verification
TestStorageSubConsistencyRejectswraps memfs with aSubthat is a separate storage, one whoseGetanswers its own ETag, one that drops Content-Type and metadata, one whoseListanswers its own ETag, and one whoseDeletedoes nothing, and checks that the helper reports each; an unwrappedSubpasses.fsat every step: Put, PutMetadata and List each disagree between the root and theSub.