Skip to content

test(linux): assert reservation failure and empty-reservation cleanup paths - #331

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-reservation-cleanup
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-reservation-cleanup

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

#330 made unique_shot_path reserve the screenshot name as an empty file (noclobber) before the capture tool runs, and added an EXIT trap that removes the 0-byte reservation when the capture fails. Two arms of that change shipped without an asserting test:

  • the return 1 / die "cannot reserve a screenshot file in …" arm when the reservation fails for a reason other than "name taken" — hotshot-capture.sh:162 was the only line scripts/shell-coverage.sh reported uncovered at 7f4a1ba (99%, 201/202);
  • the trap dropping the empty reservation after maim fails or slurp is cancelled — the existing "capture failure" and "cancelled slurp" cases asserted exit 1 and "nothing typed" but not that no 0-byte PNG is left behind.

This adds unit assertions for the unwritable-directory reservation failure, an e2e run against a read-only shot dir asserting the die message, and "empty reservation removed" assertions on the two existing failure cases. Removing either arm from the script fails 5 of the new assertions (verified by mutation locally); the unwritable-dir runs are bounded by timeout so a regression that keeps probing -N names fails instead of hanging CI. Root (which ignores mode bits) skips the chmod-based cases explicitly rather than hanging.

Shell coverage: linux/hotshot-capture.sh 99% → 100% (202/202); all 294 assertions pass locally.


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

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

… paths

#330 reserves the screenshot name as an empty file before capture and
removes it from an EXIT trap when the capture fails. Two of its arms had
no asserting test: the die when the reservation itself cannot be made
(the only uncovered line in hotshot-capture.sh), and the trap dropping
the 0-byte reservation after maim fails or slurp is cancelled. Dropping
either arm now fails the suite instead of passing; the unwritable-dir
runs are bounded by timeout so a regression that keeps probing -N names
fails rather than hangs CI. Lifts hotshot-capture.sh shell coverage from
99% (201/202) to 100%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 6236ec6 into main Oct 31, 2026
11 of 12 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-reservation-cleanup branch October 31, 2026 10:03
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#33110f48cf` sha256:1b5a46161f4292591ddecc9093cdd20dcbee947d911d57e31d3a263a5f07b288 — download from the dashboard or `hivectl review evidence #331`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants