Skip to content

[ESSREDUCE] test: skip on windows - #882

Open
jokasimr wants to merge 3 commits into
mainfrom
fix-weekly
Open

jokasimr wants to merge 3 commits into
mainfrom
fix-weekly

Conversation

@jokasimr

@jokasimr jokasimr commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #880

The test doesn't work on windows because chmod(0) still leaves the file readable.

@github-actions github-actions Bot added the essreduce Issues for essreduce. label Nov 17, 2026
@github-actions github-actions Bot changed the title test: skip on windows [ESSREDUCE] test: skip on windows Nov 17, 2026
@jokasimr
jokasimr enabled auto-merge November 17, 2026 10:30
@jokasimr
jokasimr requested a review from jl-wynen November 19, 2026 08:52

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the context of this test. Why does it use chmod to begin with? If it's about disabling access to an input file mid-merge, you can just delete the file. Or trigger a write failure in some other way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either. Might be no particular reason.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, the comment didn't explain it. The failure must happen after write has created merged.nxs.partial, i.e. when opening the second input, so the cleanup is actually exercised. Deleting the file fails earlier: the size/mtime check at the start of write raises FileNotFoundError before .partial exists, and the test would pass even with the cleanup removed (checked). That's why chmod, which keeps size and mtime.

6e73d10 replaces chmod with overwriting the file with zeros and restoring its mtime, which should also work on Windows, so the skip is gone. The write docstring now also says why a partial output must never exist: it starts as a copy of the first run's file and looks valid.

@jokasimr

Copy link
Copy Markdown
Contributor Author

Added @SimonHeybrock as reviewer to answer the question about the test context.

chmod(0) does not prevent reads on Windows. Overwrite the second input
with zeros of the same size and restore its modification time instead:
opening it fails after the partial file exists, while the size and
modification time check in write still passes. Deleting the file would
not work, since that check would then fail before the partial file is
created and the cleanup would go untested.

Document in the write docstring why a partial output must not exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jokasimr
jokasimr added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026

This branch has not been deployed

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

Labels

essreduce Issues for essreduce.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weekly Platform Test Failures 2026-11-16

3 participants