Repository navigation
mutate: a run's temporary directory is removed when a killed test left it read-only - #102
Merged
Merged
Conversation
…t it read-only A test that makes a directory read-only restores it in t.Cleanup, which never runs when an edit hangs the test and mutate kills the binary at its timeout. os.RemoveAll then could not unlink the files, and the whole run failed at its cleanup after every edit was answered (spin's platformimages test: unlinkat .../002/mkfs.ext4: permission denied). Each directory is made its owner's to write and search before the removal, as the go command's removeAll does for a read-only module cache; WalkDir does not follow links, so nothing outside the temporary directory changes mode. A removal that still fails is still an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf
force-pushed
the
mutate-remove-readonly-tmp
branch
from
November 12, 2026 18:20
284721a to
63a8f12
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.
spin's mutate lane failed at its cleanup after every edit was refused:
mutate: removing the temporary directory of ...'s tests: unlinkat /tmp/m2060458/TestAnArtifactIsShownPublishingWhileItIsbase1715224689/002/mkfs.ext4: permission denied.spin's platformimages test makes a 0o500 directory of 0o400 files and restores it in
t.Cleanup; when an edit hangs that test, mutate kills the binary at its timeout, the cleanup never runs, andos.RemoveAllcannot unlink the files.removeAll(internal/mutate/tree.go) walks the run's temporary directory making each directory 0o700 before removing it, as the go command's own removeAll does for a read-only module cache.filepath.WalkDirdoes not follow links, so nothing outside the directory changes mode. A removal that still fails is still an error.Test:
TestATemporaryDirectoryAKilledTestLeftReadOnlyIsRemoved- a read-only tree is removed; a link to a read-only directory outside keeps its target's files and 0500 mode; a directory already gone is no error. Planted: no chmod (red with the same unlinkat error spin saw); chmod through links (red: the target became 0700).🤖 Generated with Claude Code