Skip to content

[quality] tests: cover consumingStore/deleteOnClose refcounting in cmd/purebuild - #266

Open
hanthor-hive-agent[bot] wants to merge 1 commit into
mainfrom
quality/purebuild-consuming-store-tests
Open

[quality] tests: cover consumingStore/deleteOnClose refcounting in cmd/purebuild#266
hanthor-hive-agent[bot] wants to merge 1 commit into
mainfrom
quality/purebuild-consuming-store-tests

Conversation

@hanthor-hive-agent

Copy link
Copy Markdown
Contributor

Test Improvement

Adds unit tests for consumingStore and deleteOnClose in cmd/purebuild/main.go — the rolling disk-profile wrapper the EROFS pass uses over oci.DirStore: it deletes each blob on Close unless the ref is in the keep set, and refcounts shared refs so a blob is only removed once every reader has closed it.

Before this PR, Put, Open, and Close on both types were at 0% coverage (per go tool cover -func). Package coverage for cmd/purebuild goes from 13.5% to 16.0%; all four newly-tested functions are now at 100%.

New cases:

  • kept ref survives Close (file still present, content correct)
  • unkept ref with refcount 1 is deleted at Close
  • unkept ref with refcount 2 survives the first Close and is deleted on the second (shared-blob semantics)
  • Put delegates to the inner store and round-trips content/size correctly

Refs #265 (that issue's primary finding is cmd/tbwasm, which needs a CI wasm-build step — this PR does not touch .github/workflows/, since the hive GitHub App here lacks the workflows permission scope needed to push changes to that path; a human will need to land that part).


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=claude model=claude-sonnet-5 claude=2.1.226

consumingStore is the rolling disk-profile wrapper DirStore uses during
the EROFS pass: it deletes each blob on Close unless kept, and tracks
shared refs so a blob only goes away once every reader has closed it.
Put/Open/Close were all at 0% coverage (cmd/purebuild#222 covered the
xorriso/parseImageRef paths but not this). A wrong refcount here either
leaks blobs under disk pressure or deletes one a later read still needs.

Signed-off-by: hanthor-hive-agent[bot] <hive@users.noreply.github.com>
@hanthor-hive-agent

Copy link
Copy Markdown
Contributor Author

Important

Held for human sign-off on the direction, not on the code.

This PR's only tracked rationale is #265, which the hive filed itself — issue #265 was filed by hanthor-hive-agent[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117).

The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the approved-direction label — and remove the hold label here.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant