Skip to content

TST: flaky test test_agg_consistency on Python 3.5 #27124

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

The following tests fails from time to time on Python 3.5 builds

=================================== FAILURES ===================================
_____________________________ test_agg_consistency _____________________________
[gw0] darwin -- Python 3.5.6 /Users/vsts/miniconda3/envs/pandas-dev/bin/python

    def test_agg_consistency():
    
        # make sure that we are consistent across
        # similar aggregations with and w/o selection list
        df = DataFrame(np.random.randn(1000, 3),
                       index=pd.date_range('1/1/2012', freq='S', periods=1000),
                       columns=['A', 'B', 'C'])
    
        r = df.resample('3T')
    
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            expected = r[['A', 'B', 'C']].agg({'r1': 'mean', 'r2': 'sum'})
            result = r.agg({'r1': 'mean', 'r2': 'sum'})
>       assert_frame_equal(result, expected)

pandas/tests/resample/test_resample_api.py:250: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/_libs/testing.pyx:65: in pandas._libs.testing.assert_almost_equal
    cpdef assert_almost_equal(a, b,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise_assert_detail(obj, msg, lobj, robj)
E   AssertionError: MultiIndex level [0] are different
E   
E   MultiIndex level [0] values are different (100.0 %)
E   [left]:  Index(['r2', 'r2', 'r2', 'r1', 'r1', 'r1'], dtype='object')
E   [right]: Index(['r1', 'r1', 'r1', 'r2', 'r2', 'r2'], dtype='object')

pandas/_libs/testing.pyx:178: AssertionError

See eg https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=13625&view=logs&jobId=521b7dfd-2989-5ff8-bc8c-7481906480fa

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unreliable TestUnit tests that occasionally fail

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions