Closed
Description
Duplicates
- I have searched the existing issues
Current behavior 😯
Tests fail, often in different ways
Expected behavior 🤔
Tests pass
Steps to reproduce 🕹
$ git --version
git version 2.34.1
$ git lfs --version
git-lfs/3.0.2 (GitHub; linux amd64; go 1.18.1)
$ git clone https://github.com/Byron/gitoxide.git
$ git lfs install
$ git lfs pull
$ just test
...
failures:
---- index::file::read::sparse_checkout_non_sparse_index stdout ----
Archive at 'fixtures/generated-archives/v3_skip_worktree.tar.xz' not found, creating fixture using script 'make_index/v3_skip_worktree.sh'
thread 'index::file::read::sparse_checkout_non_sparse_index' panicked at 'assertion failed: `(left == right)`
left: `Flags(EXTENDED | SKIP_WORKTREE)`,
right: `Flags(0x0)`', gix-index/tests/index/file/read.rs:245:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
index::file::read::sparse_checkout_non_sparse_index
test result: FAILED. 41 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s
error: test failed, to rerun pass `-p gix-index-tests --test single-threaded`
error: Recipe `unit-tests` failed on line 132 with exit code 101
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: gix-commitgraph/tests/fixtures/generated-archives/octopus_merges.tar.xz
modified: gix-diff/tests/fixtures/generated-archives/make_diff_repo.tar.xz
modified: gix-index/tests/fixtures/generated-archives/v3_skip_worktree.tar.xz
no changes added to commit (use "git add" and/or "git commit -a")
$ git reset --hard
$ cargo test --all --exclude gix-index-tests
...
failures:
---- worktree::checkout::accidental_writes_through_symlinks_are_prevented_if_overwriting_is_forbidden stdout ----
Extracted fixture from archive 'tests/fixtures/generated-archives/make_dangerous_symlink.tar.xz' (3715112181, Some("unix"))
thread 'worktree::checkout::accidental_writes_through_symlinks_are_prevented_if_overwriting_is_forbidden' panicked at 'assertion failed: `(left == right)`
left: `["A-dir/a", "A-file", "fake-dir/b", "fake-file"]`,
right: `["A-dir/a", "A-file", "FAKE-DIR", "FAKE-FILE", "fake-dir/b", "fake-file"]`', gix-worktree/tests/worktree/checkout.rs:81:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- worktree::cache::attributes::baseline stdout ----
Extracted fixture from archive 'tests/fixtures/generated-archives/make_attributes_baseline.tar.xz' (2874926218, Some("unix"))
thread 'worktree::cache::attributes::baseline' panicked at 'assertion failed: `(left == right)`
left: `[AssignmentRef { name: NameRef(Borrowed("info")), state: Value(ValueRef(Borrowed("attributes"))) }]`,
right: `[AssignmentRef { name: NameRef(Borrowed("global-no-wildcard-case-test")), state: Set }, AssignmentRef { name: NameRef(Borrowed("global-wildcard-case-test")), state: Set }, Assignmen
tRef { name: NameRef(Borrowed("info")), state: Value(ValueRef(Borrowed("attributes"))) }]`: we have the same matches: "Z/x/a"', gix-worktree/tests/worktree/cache/attributes.rs:53:9
---- worktree::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed stdout ----
thread 'worktree::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed' panicked at 'assertion failed: `(left == right)`
left: `["A-dir/a", "A-file", "fake-dir/b", "fake-file"]`,
right: `["A-dir/a", "A-file", "FAKE-DIR", "FAKE-FILE", "fake-dir/b", "fake-file"]`', gix-worktree/tests/worktree/checkout.rs:110:9
failures:
worktree::cache::attributes::baseline
worktree::checkout::accidental_writes_through_symlinks_are_prevented_if_overwriting_is_forbidden
worktree::checkout::writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed
test result: FAILED. 19 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s
error: test failed, to rerun pass `-p gix-worktree --test worktree-single-threaded`
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: gix-odb/tests/fixtures/generated-archives/make_repo_multi_index.tar.xz
modified: gix-worktree/tests/fixtures/generated-archives/make_ignorecase_collisions.tar.xz
no changes added to commit (use "git add" and/or "git commit -a")
$ git reset --hard
$ cargo test --all --exclude gix-index-tests --exclude gix-worktree
$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
epage commentedon Aug 2, 2023
My other worktree is seeing:
epage commentedon Aug 2, 2023
Likely unrelated but a job for #956 failed but later jobs didn't and related jobs didn't
See https://github.com/Byron/gitoxide/actions/runs/5733348381/job/15537902571
Byron commentedon Aug 3, 2023
Thanks a lot for the methodical listing of issues executing the test-suite, it's easy to follow what happened and I am trying to reproduce this on a debian system with a case-sensitive file-system.
Just for completeness, regarding the comment right above this one, I have seen this before happen occasionally, but only on CI. My feeling is that it's related to the local state 'somehow', and it only happens when the code is run with multi-threading enabled (via
gix-features
). I don't know if it always happens for you though, and if so, I hope to see the same issue locally.Everything else seems state-related, even though it doesn't yet make much sense to me. Maybe there is an issue with some of the
git-lfs
archives being created on MacOS, and a case-sensitive file-system. That would be strange, as CI runs on linux without git-lfs, so it recreates all state by executing the source script, while also running the archived versions on MacOS and Windows… both of which expect a case-sensitive file-system. CI doesn't actually run the archived version on Linux, coincidentally actually.The above gave me a lead. It seems that…
test-fast
on linux as it would rely on archives (and probably fail because of it)Ideally, the above should fix all of the issues except for maybe
keep_going_collects_results
- I will keep you posted.run fast tests on linux-CI as well (#960)
Byron commentedon Aug 3, 2023
It wasn't easy and took quite some time but I think that all of these issues should go away if you rebase onto
main
and clear out the working tree to get rid of the possibly incorrect caches.Please let me know if there are any issues remaining, but it works for me now on my linux VM.
niklaswimmer commentedon Aug 3, 2023
Just as an extra data point: on my system (Arch Linux) both
just test
andjust nextest
now work. Thetest
suite already worked before the latest changes, thenextest
suite not.epage commentedon Aug 4, 2023
Hmm, I'm still seeing this failure:
However, that is now my only failure.
cargo test --exclude gix-index-tests
passesByron commentedon Aug 5, 2023
In this situation, this script executes and it's expected to produce an index with entries that have certain flags.
This doesn't happen, even though the script doesn't fail.
Can I see the
git --version
you are using?Lastly, as the correct index is contained in the archive that is not available, and if you clear local caches with something like
find gix-index -name generated-do-not-edit -exec rm -Rfv \{\} \;
and fetch the archives usinggit-lfs
this test should pass, too.But overall, I am glad this works so much better now and hope that the additional CI test on linux will help to prevent regressions.
epage commentedon Aug 6, 2023
Still failing after running that command and doing a
git lfs pull
andgit lfs fetch
(just covering all my bases). I had originally cloned a new repo for this anyways, so all of the caches were clean when I did the above testuing.try to prevent 'git' reading user and system configuration (#960)
Byron commentedon Aug 6, 2023
Thanks for trying again!
This gets more and more mysterious. The git version used should be able to produce the desired index file, and if not I'd assume it would fail.
If the index is as expected, it would mean the software truly regressed. I thought that it's maybe related to something that happened in the
winnow
branch, but after retrying there is still worked for me.So I thought maybe we can do one more test to rule out the data is invalid. If you could do the following:
index
: 010c0c5fe37833d6aca6d8dca7928e60725b50b4)sha1 gix-index/tests/fixtures/generated-do-not-edit/v3_skip_worktree/1190435892-unix/.git/index
- if it's not the hash above copy the downloadedindex
file togix-index/tests/fixtures/generated-do-not-edit/v3_skip_worktree/1190435892-unix/.git/index
Now the test should work as expected as it's definitely the correct file.
git
does pick up user configuration naturally and maybe that's picking up some configuration that does indeed affect that particular test. Maybe that could be it, let's see.try to prevent 'git' reading user and system configuration (#960)
try to prevent 'git' reading user and system configuration (#960)
try to prevent 'git' reading user and system configuration (#960)
epage commentedon Aug 7, 2023
My user config: https://github.com/epage/vimfiles/blob/master/extra/config/git/config
btw I was generally doing these tests on
master
to avoid my changes being involvedByron commentedon Aug 8, 2023
Nothing looks unusual, but nonetheless I (think to) have prevented
git
from reading system and user configs to isolate the test-suite more.It seems all that's left is to try to use the provided
index.zip
file (see my comment above) if you get the chance.epage commentedon Aug 8, 2023
Ah, accidentally read over those steps.
How do you normally get a
sha1
binary? apt isn't suggesting any.Byron commentedon Aug 8, 2023
It appears to be part of
coreutils
.~$ dpkg -S sha1sum coreutils: /usr/share/man/man1/sha1sum.1.gz coreutils: /usr/bin/sha1sum
epage commentedon Aug 8, 2023
Ah,
sum
was missing at the endBefore with failure:
Swapping in the provided index got me past that failure and now I'm getting
and
Byron commentedon Aug 9, 2023
That's great, and means that somehow
git
didn't produce the result it was supposed to. It's unclear to me what happened there. The next time thegenerated-do-no-edit
folder is wiped without the archives being pulled, the error might return as it would re-execute the script. I hope you can rebase againstmain
so thatgit
shouldn't be able anymore to read user and system configuration.It looks like the test implicitly relies on the
gh
tool to be installed, and if it's not it fails as the output changes.on
main
this is fixed as well by skipping these tests ifgh
isn't present.Thanks for taking another look, maybe it runs through now :D.
epage commentedon Aug 10, 2023
I guess this can be closed for now?
writes_through_symlinks_are_prevented_even_if_overwriting_is_allowed
failure #2006