a_failed_rename_leaves_the_row_alone fails in CI because CI is root #256

Open
opened 2026-08-25 22:40:07 +01:00 by naps62-yolo · 0 comments
Owner

movies::tests::a_failed_rename_leaves_the_row_alone has failed on every
main push since it landed in bce3d38. The rust job is the only red one;
web and e2e are green.

thread 'movies::tests::a_failed_rename_leaves_the_row_alone' panicked at
crates/arr-api/src/movies.rs:1861:9:
assertion `left == right` failed
  left: 200
 right: 500

The test freezes the title folder to 0o555 and expects the move to fail:

tokio::fs::set_permissions(&folder, std::fs::Permissions::from_mode(0o555))

CI runs as root — .gitea/workflows/ci.yml calls apt-get install with no
sudo — and root ignores the permission bits, so the rename succeeds and the
handler returns 200. The same test passes on a developer machine, which is why
just ci is green locally and red in CI.

Because nextest cancels on first failure, one root-only failure hides the other
506 tests in that job. That is the more expensive half of this.

Options, roughly in order of preference:

  1. Make the failure not depend on the caller's privilege — point the
    destination at something a rename cannot succeed onto regardless of uid
    (an existing non-empty directory, or a path component that is a file).
  2. Skip the test when geteuid() == 0, and say so in the skip reason.
  3. Run the rust job as a non-root user.

(1) keeps the assertion honest everywhere and is the only one that still tests
anything in CI.

Found while merging the Subtitles milestone into main; the failure predates
that merge and is unrelated to it.

`movies::tests::a_failed_rename_leaves_the_row_alone` has failed on every `main` push since it landed in bce3d38. The `rust` job is the only red one; `web` and `e2e` are green. ``` thread 'movies::tests::a_failed_rename_leaves_the_row_alone' panicked at crates/arr-api/src/movies.rs:1861:9: assertion `left == right` failed left: 200 right: 500 ``` The test freezes the title folder to `0o555` and expects the move to fail: ```rust tokio::fs::set_permissions(&folder, std::fs::Permissions::from_mode(0o555)) ``` CI runs as root — `.gitea/workflows/ci.yml` calls `apt-get install` with no `sudo` — and root ignores the permission bits, so the rename succeeds and the handler returns 200. The same test passes on a developer machine, which is why `just ci` is green locally and red in CI. Because nextest cancels on first failure, one root-only failure hides the other 506 tests in that job. That is the more expensive half of this. Options, roughly in order of preference: 1. Make the failure not depend on the caller's privilege — point the destination at something a rename cannot succeed onto regardless of uid (an existing non-empty directory, or a path component that is a file). 2. Skip the test when `geteuid() == 0`, and say so in the skip reason. 3. Run the `rust` job as a non-root user. (1) keeps the assertion honest everywhere and is the only one that still tests anything in CI. Found while merging the Subtitles milestone into `main`; the failure predates that merge and is unrelated to it.
naps62-yolo added the area/cidifficulty/easytype/test labels 2026-08-25 22:40:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/arr#256