Skip to content

Check for predictable temporary file names while cronic runs the command - #131

Merged
mernst merged 2 commits into
plume-lib:masterfrom
mernst:cronic-temp-file-test
Oct 9, 2026
Merged

mernst merged 2 commits into
plume-lib:masterfrom
mernst:cronic-temp-file-test

Conversation

@mernst

@mernst mernst commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

temp-file-test.sh checks that cronic's temporary file names are not derived from its process id. It looked for those names from within the wrapped command, using $PPID as cronic's process id. That check passes vacuously if the wrapped command's parent is not cronic itself (for example, if cronic runs the command in a subshell), and it never confirmed that cronic had any temporary files to look at.

This pull request:

  • checks, while the wrapped command is running, the names under $TMPDIR and the predictable names under /tmp, using cronic's own process id;
  • fails if cronic has no temporary files at that time, so that the test cannot pass vacuously;
  • shares the "wait for the command to start" helper between the two tests.

Only the test changes; cronic does not. This is split out of #129.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: plume-lib/plume-scripts/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 317079b4-6fa7-4dbd-ad57-417ed0ce4d8e
📥 Commits

Reviewing files that changed from the base of the PR and between d37c363 and 73b1f46.

📒 Files selected for processing (1)
  • tests/cronic-test/temp-file-test.sh
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The wrapped command writes a unique marker, and the test checks that every
file containing it is in a private `mktemp -d` directory under $TMPDIR.
This detects any predictable naming scheme, avoids false matches of short
process ids, reports unsafe files before the vacuity check, tolerates find
errors, and lets the wrapped command exit if the test exits early.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mernst
mernst merged commit c05fea7 into plume-lib:master Oct 9, 2026
7 checks passed
@mernst
mernst deleted the cronic-temp-file-test branch October 11, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant