Skip to content

Test overwrite_existing apparent symlink dereferencing #2008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

EliahKagan
Copy link
Member

@EliahKagan EliahKagan commented May 10, 2025

To investigate #2006, this explodes the occasionally failing test writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed into 1000 identical tests, using test_case::test_matrix.

When run in series, they all pass, but when run in parallel with cargo nextest, some failures always occur, at least when this is done on macOS. This is as predicted in #2006 (comment).

A more specific result in local testing on macOS 15 is that, while the number of failures is 0 with --test-threads=1, with 2 or more threads, the number of failures tends to decrease with the number of threads. The most failures occur with --test-threads=2, about 30 on the system tested, while --test-threads=16 has about 10 failures.

The tests were run with this command, with any --test-threads=<N> argument added:

cargo nextest run -p gix-worktree-state-tests writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed --no-fail-fast

See #2006 (comment) for substantial further details, including more up to date information covering reproduction on other platforms--it turns out not to be just macOS--and other relevant information and ideas.

(Maybe this PR can turn into a fix, once the cause is figured out. If not, it could be superseded by the fix and closed.)

To investigate GitoxideLabs#2006, this explodes the occasionally failing test
`writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed`
into 1000 identical tests, using `test_case::test_matrix`.

When run in series, they all pass, but when run in parallel with
`cargo nextest`, some failures always occur, at least when this is
done on macOS. This is as predicted in:
GitoxideLabs#2006 (comment)

A more specific result in local testing on macOS 15 is that, while
the number of failures is 0 with `--test-threads=1`, with 2 or more
threads, the number of failures tends to *decrease* with the number
of threads. The most failures occur with `--test-threads=2`, about
30 on the system tested, while `--test-threads=16` has about 10
failures.

The tests were run with this command, with any `--test-threads=<N>`
argument added:

    cargo nextest run -p gix-worktree-state-tests writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed --no-fail-fast
To see if this can sometimes reproduce GitoxideLabs#2006 even outside macOS.

The `fail-fast: false` added here can be removed after testing.
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