Remove unnecessary xfail from original flaky test test_union_different_types #62457
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.
Investigation
The test function pandas.tests.indexes.test_setops::test_union_different_types was identified as potentially flaky by this issue: #46144.
To isolate the behavior, I managed to target a set of specific parameterizations that was unexpectedly passing:
[nullable_bool-repeats]
[repeats-nullable_bool]
[repeats-bool-dtype]
[bool-dtype-repeats]
I ran this single test case repeatedly for 50 times.
The result was all xpassed and 0 xfailed.
This demonstrates that this specific test case is either not flaky, or the flakiness has been reduced. The xfail marker, originally added for issue GH#44000, is no longer necessary for this parameter set.
While the overall test function appeared flaky due to the mix of xfailed and xpassed results, the evidence suggests the root cause is several outdated xfail markers rather than non-deterministic behavior.
Change
This PR proposes to remove the @pytest.mark.xfail decorator for the mentioned parameter set. The test will now run and pass as a standard test.