Description
Current behavior 😯
The test failure
Yesterday, I got a failure of writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed
on CI in a macOS job run in my fork:
FAIL [ 0.010s] gix-worktree-state-tests::worktree state::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed
stdout ───
running 1 test
test state::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed ... FAILED
failures:
failures:
state::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 14 filtered out; finished in 0.00s
stderr ───
thread 'state::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed' panicked at gix-worktree-state/tests/state/checkout.rs:122:9:
assertion `left == right` failed
left: ["A-dir/a", "A-file", "FAKE-DIR", "fake-file"]
right: ["A-dir/a", "A-file", "FAKE-DIR", "FAKE-FILE"]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Changes on the branch
This job was run on e0a8dfe in EliahKagan#31, which is a Dependabot PR. (I sometimes have open Dependabot PRs in my fork, to pre-test possible dependency versions.)
But it seems to me that the failure is probably not related to any upgraded dependencies. I ran the workflow four more times, and neither that test, nor any others in that job, nor any other job in the workflow, failed in any other runs. Also...
Vague recollections
The diff of this failure, where the capitalization of FAKE-FILE
changes, looks very familiar to me. I think I have seen it on CI before. That seems strange: considering the importance of the test, one would think I would've brought it up, had I seen it before--in case it was not a false positive.
It could be that this looks familiar because it is a form a true failure could take, which I had seen at some point in the past when experimenting with the test. I wish I remembered.
I am for some reason reminded of #1832. That relates to a different test case. But maybe something related to this was going on at the same time? Sorry about the vagueness of these guesses.
Searching for the failure finds only #960. But the failure there was different--it did not have the same value as is found in the assertion here.
Case-insensitivity
The assertion that failed here was:
gitoxide/gix-worktree-state/tests/state/checkout.rs
Lines 122 to 130 in 9d0c809
Which assertions run in that test case is determined by the value of opts.fs.ignore_case
. But I expect this typically to be true
on macOS, and this assertion that failed is in the true
branch of that check. Accordingly, I don't think the problem is due to a failure to detect whether the filesystem is case-sensitive.
Expected behavior 🤔
The test should always pass.
Git behavior
I'm not sure if there's a specific relevant Git behavior to look at here. But both Git and gitoxide generally avoid dereferencing and writing through symlinks. This test attempts to check that gitoxide does that.
Either there is some circumstance under which gitoxide fails to avoid that (and this circumstance can occur on macOS), or there is a bug in the test or something the test uses, or there was a problem on the runner that somehow caused the filename's case to change without causing any other tests in the run to fail. (All these possibilities are, of course, unexpected.)
Steps to reproduce 🕹
Unfortunately, I don't know to intentionally reproduce this.