Skip to content

TST: flaky test_single_axis on Dask #272

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

crusaderky
Copy link
Contributor

I'm observing random failures in Dask in this test.
The reason is that xp_assert_equal() is calling dask.compute() twice, which in turn rematerializes the graph from scratch twice - thus calling np.empty twice. That in turn occasionally returns differently dirty memory between expect and actual.

@@ -521,7 +521,7 @@ def test_xp(self, xp: ModuleType):
class TestExpandDims:
def test_single_axis(self, xp: ModuleType):
"""Trivial case where xpx.expand_dims doesn't add anything to xp.expand_dims"""
a = xp.empty((2, 3, 4, 5))
a = xp.asarray(np.reshape(np.arange(2 * 3 * 4 * 5), (2, 3, 4, 5)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hack to make sparse work. This pattern is already used elsewhere.

@lucascolley lucascolley added this to the 0.7.2 milestone Apr 22, 2025
@lucascolley lucascolley merged commit 6998deb into data-apis:main Apr 22, 2025
10 checks passed
@crusaderky crusaderky deleted the flaky_empty branch April 22, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants