Repository navigation
test: fix Windows-only and flaky failures in config tests - #263
Open
theprinceraj wants to merge 1 commit into
Open
theprinceraj wants to merge 1 commit into
theprinceraj wants to merge 1 commit into
Conversation
theprinceraj
force-pushed
the
fix/windows-flaky-config-tests
branch
from
November 22, 2026 19:33
9b34e8a to
aac314f
Compare
Author
|
Coverage failure is unrelated, the job dies on Branch only exists on my fork, so this'll happen on any fork PR. Checking out |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
config_testfailures on Windows: one test that always failed, and two that failed now and then.test_read_input_paths_from_stdinalways failed on WindowsIt spawns
echoas a process. On Windowsechois a shell built-in, not a program, so the call fails withprogram not found. The test is now ignored on Windows withcfg_attr(windows, ignore = ...), and the reason appears in the test output.Flaky
test_validate_config_*failuresFour
test_output_template_*tests callset_current_dir, which changes the working directory for the whole test process.CONFIG_TEST_MUTEXonly serialized those four with each other. Other tests in the file use relative output paths ("output","/tmp/yek"), and they sometimes ran inside another test's temp folder while it was being deleted:The four tests (and the mutex) now live in
tests/config_cwd_test.rs. Each test file runs as its own process, so they can no longer change the working directory of other tests.I also gave two assertions failure messages, so they print the actual error instead of only
assertion failed.Testing (Windows 11)
RUST_TEST_THREADS=16: 4–6 failing runs per 600 before, 0 in 600 aftercargo test --test config_test --test config_cwd_testandcargo fmt --checkpassNot in scope
These problems on Windows were already there before this PR, and it doesn't change them:
parallel_test: 4 failures from\vs/path separatorssymlink_test: unused-import warnings, because its tests are#[cfg(unix)]