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

Already on GitHub? Sign in to your account

Parallelize the test suite and fix a test polluted bug #1338

Merged
merged 12 commits into from
May 30, 2024
Merged

Parallelize the test suite and fix a test polluted bug #1338

merged 12 commits into from
May 30, 2024

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented May 22, 2024

I see this flaky test: datashader/tests/test_quadmesh.py::test_raster_quadmesh_autorange_reversed[dask.array]
Not flaky at all: pytest 'datashader/tests/test_quadmesh.py::test_raster_quadmesh_autorange_reversed[dask.array]' as this also fails. It is test pollution from the other array...

Want to merge it after my other prs.

@hoxbro hoxbro marked this pull request as draft May 22, 2024 07:49
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 85.63%. Comparing base (1bf733e) to head (79b5883).
Report is 1 commits behind head on main.

Current head 79b5883 differs from pull request most recent head 65f146b

Please upload reports for the commit 65f146b to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1338      +/-   ##
==========================================
+ Coverage   85.57%   85.63%   +0.06%     
==========================================
  Files          51       53       +2     
  Lines       11296    11316      +20     
==========================================
+ Hits         9667     9691      +24     
+ Misses       1629     1625       -4     

@hoxbro
Copy link
Member Author

hoxbro commented May 22, 2024

Before After
image image

@hoxbro hoxbro marked this pull request as ready for review May 22, 2024 11:20
Comment on lines +176 to +177
xbinsize = abs(float(xr_ds[x_name][1] - xr_ds[x_name][0]))
ybinsize = abs(float(xr_ds[y_name][1] - xr_ds[y_name][0]))
Copy link
Member Author

@hoxbro hoxbro May 22, 2024

Choose a reason for hiding this comment

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

These were causing the failing test, as they both were -1. I can't see any reason why these should not be positive.

For reference: pytest 'datashader/tests/test_quadmesh.py::test_raster_quadmesh_autorange_reversed[dask.array]'

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense.

@@ -254,7 +254,7 @@ def to_numpy_dtype(self):
return np.dtype('datetime64[us]')


_units = set(['ns', 'us', 'ms', 's', 'm', 'h', 'D', 'W', 'M', 'Y'])
_units = ('ns', 'us', 'ms', 's', 'm', 'h', 'D', 'W', 'M', 'Y')
Copy link
Member Author

Choose a reason for hiding this comment

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

pytest-xdist can't handle sets as the order are not consistent, see here.

@@ -0,0 +1,34 @@
CUSTOM_MARKS = ("benchmark",)
Copy link
Member Author

Choose a reason for hiding this comment

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

Copied from HoloViews. Basically, it makes it so benchmark only runs when you pass in --benchmark. Benchmark does not work with pytest-xdist (it emits a warning if both are enabled at the same time, which is why I disable it with --benchmark-skip.

At some point, I would also like to add a GPU marker, so it is possible to run only the GPU tests and not all the tests with GPU tests enabled.

@hoxbro hoxbro added this to the v0.16.2 milestone May 22, 2024
@hoxbro hoxbro changed the title Parallelize the test suite Parallelize the test suite and fix a test polluted bug May 22, 2024
@hoxbro hoxbro requested a review from philippjfr May 22, 2024 18:11
@hoxbro hoxbro mentioned this pull request May 23, 2024
@hoxbro hoxbro merged commit d6cbacf into main May 30, 2024
2 checks passed
@hoxbro hoxbro deleted the parallel branch May 30, 2024 08:41
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

Successfully merging this pull request may close these issues.

2 participants