Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 test env::tests::test_env_parsing_with_pager_set_to_bat ... FAILED #1660

Open
vt-alt opened this issue Mar 17, 2024 · 4 comments
Open

Comments

@vt-alt
Copy link

vt-alt commented Mar 17, 2024

When building a detla package for ALT from the tag 0.17.0 tests fail with:

[00:00:50] + cargo test -j32 --release --no-fail-fast
...
[00:01:08] failures:
[00:01:08] 
[00:01:08] ---- env::tests::test_env_parsing_with_pager_set_to_bat stdout ----
[00:01:08] thread 'env::tests::test_env_parsing_with_pager_set_to_bat' panicked at src/env.rs:79:9:
[00:01:08] assertion `left == right` failed: Expected env.pagers.1 == Some(bat) but was Some("less")
[00:01:08]   left: Some("less")
[00:01:08]  right: Some("bat")
[00:01:08] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[00:01:08] 
[00:01:08] 
[00:01:08] failures:
[00:01:08]     env::tests::test_env_parsing_with_pager_set_to_bat
[00:01:08] 
[00:01:08] test result: FAILED. 377 passed; 1 failed; 8 ignored; 0 measured; 0 filtered out; finished in 0.42s
[00:01:08] 
[00:01:08] error: test failed, to rerun pass `--bin delta`
[00:01:08] error: 1 target failed:
[00:01:08]     `--bin delta`

Temporary build log: https://git.altlinux.org/tasks/342942/build/100/x86_64/log

Interestingly, when I try to reproduce this on other host with the same build env it does not fail:

21:23:11 test env::tests::test_env_parsing_with_pager_set_to_bat ... ok

Both envs do not have bat binary. If bat binary is installed the test fails anyway.

ps. It looks like the test fails probabilistically. But because we have 4 build architectures, it fails with a high probability when build for all of them. Stat from different build runs:

subtask  name   aarch64    i586  ppc64le  x86_64
   #100  delta     3:54  failed     4:17  failed

subtask  name   aarch64  i586  ppc64le  x86_64
   #100  delta     3:53  2:11   failed  failed

subtask  name   aarch64    i586  ppc64le  x86_64
   #100  delta     3:55  failed   failed  failed
@dandavison
Copy link
Owner

Hi, thanks for the issue. This is a flaky test that relies on setting environment variables (which in general does not work with Rust tests seeing as they are executed concurrently by default). It needs to be re-written, perhaps using something like https://github.com/vmx/temp-env

@vt-alt
Copy link
Author

vt-alt commented Mar 17, 2024

IC. Thanks for answer! I will run them with cargo test ... -- --test-threads=1 (already tested to work OK).

@dandavison
Copy link
Owner

Great! Sorry about that; we will fix it soon.

@sashkab
Copy link

sashkab commented Mar 17, 2024

same issue on armhf build for alpine. Will try @vt-alt's suggestion.

al3xtjames added a commit to al3xtjames/nixpkgs that referenced this issue Apr 21, 2024
One of the tests (test_env_parsing_with_pager_set_to_bat) sets an
environment variable, which can be flaky with multiple threads (see
dandavison/delta#1660). Work around this by
running the tests with 1 thread until this is fixed upstream.
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

No branches or pull requests

3 participants