Automated Flaky Test Fixes #1523
Draft
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.
Identified
sys::exec_impl::tests::test_sys_exec_disown_no_defunctas a flaky test.The root cause was a race condition where the test, which asserts that no zombie processes exist for the current process, would fail if another concurrent test spawned a process that momentarily became a zombie before being reaped.
Fixed this by introducing a
TEST_MUTEXusingonce_celland acquiring a lock in all conflicting tests withinsys/exec_impl.rs. This forces these tests to run sequentially, isolating their interactions with the system process table.Verified the fix by running the flaky test 50 times in a row without failure.
Also verified that Go and Web tests are passing.
PR created automatically by Jules for task 8584081842841595963 started by @KCarretto