Skip to content

test_reductions_2D flaky #8892

Closed
Closed

Description

@jrbourbeau

dask\array\tests\test_reductions.p::test_reductions_2D recently failed due to a RuntimeWarning: invalid value encountered in reduce being elevated to an error (see this CI build over in #8881 (review)).

Full Traceback:
___________________________ test_reductions_2D[f4] ____________________________
[gw2] win32 -- Python 3.9.12 C:\Miniconda3\envs\test-environment\python.exe

dtype = 'f4'

    @pytest.mark.slow
    @pytest.mark.filterwarnings("ignore:overflow encountered in reduce:RuntimeWarning")
    @pytest.mark.parametrize("dtype", ["f4", "i4"])
    def test_reductions_2D(dtype):
        x = np.arange(1, 122).reshape((11, 11)).astype(dtype)
        a = da.from_array(x, chunks=(4, 4))
    
        b = a.sum(keepdims=True)
        assert b.__dask_keys__() == [[(b.name, 0, 0)]]
    
        reduction_2d_test(da.sum, a, np.sum, x)
>       reduction_2d_test(da.prod, a, np.prod, x)

dask\array\tests\test_reductions.py:197: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dask\array\tests\test_reductions.py:143: in reduction_2d_test
    assert same_keys(da_func(darr, axis=()), da_func(darr, axis=()))
dask\array\reductions.py:398: in prod
    dt = getattr(np.empty((1,), dtype=a.dtype).prod(), "dtype", object)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = array([nan], dtype=float32), axis = None, dtype = None, out = None
keepdims = False, initial = <no value>, where = True

    def _prod(a, axis=None, dtype=None, out=None, keepdims=False,
              initial=_NoValue, where=True):
>       return umr_prod(a, axis, dtype, out, keepdims, initial, where)
E       RuntimeWarning: invalid value encountered in reduce

C:\Miniconda3\envs\test-environment\lib\site-packages\numpy\core\_methods.py:52: RuntimeWarning

Activity

  1. added
    tests
    on Apr 6, 2022
  2. jrbourbeau commented on Apr 7, 2022

    @jrbourbeau
    MemberAuthor

    Closed via #8893

  3. pavithraes commented on Apr 12, 2022

    @pavithraes
    Member

    @jrbourbeau Looks like the test is failing again, see this build in #8908, and this build in #8912?

  4. jorloplaz commented on Apr 12, 2022

    @jorloplaz
    Contributor

    I don't know why that is. Only happens on Windows apparently, and I didn't change anything regarding reductions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions