Skip to content

TST: local test failures #26823

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

Closed
3 of 7 tasks
jbrockmendel opened this issue Jun 12, 2019 · 3 comments
Closed
3 of 7 tasks

TST: local test failures #26823

jbrockmendel opened this issue Jun 12, 2019 · 3 comments
Labels
Unreliable Test Unit tests that occasionally fail

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Jun 12, 2019

Turning this into a tracker since more are turning up;.

  • api.test_api.test_api (much less frequently than the others) (OSX, Ubuntu)
  • frame.test_constructors.TestDataFrameConstructors.test_constructor_maskedrecarray_dtype (AttributeError: module 'numpy.ma' has no attribute 'mrecords', using numpy 1.16.4) (fixed in Assorted cleanups #26975)
  • frame.test_constructors.TestDataFrameConstructors.test_constructor_mrecarray (AttributeError: module 'numpy.ma' has no attribute 'mrecords', using numpy 1.16.4) (fixed in Assorted cleanups #26975)
  • series.indexing.test_datetime.test_index_unique (OSX) (fixed by TST: fix flaky test #27004)
  • resample.test_resample_api.test_select_bad_cols
  • io.formats.test_format.TestDataFrameFormatting.test_repr_html_long_multiindex
  • io.formats.test_format.TestDataFrameFormatting.test_info_repr_html
@simonjayhawkins
Copy link
Member

Do we have a tracker for these?

not that i'm aware of.

i'll just add these here for now.

i've see problems with pandas/tests/test_sorting.py::TestSafeSort::test_labels_out_of_bound[-1]
on a couple of occasions recently. https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=12769

and just changed desktop machine to a different gen cpu and getting clipboard errors. haven't had chance to investigate further.

although it may be best if issues for different tests are logged separately?

@jbrockmendel jbrockmendel added the Unreliable Test Unit tests that occasionally fail label Jun 13, 2019
@jbrockmendel jbrockmendel changed the title TST: local test failures on OSX TST: local test failures Jun 17, 2019
@jbrockmendel
Copy link
Member Author

The failure in series.indexing.test_datetime.test_index_unique seems to be about a fixture behaving creatively:

@pytest.fixture(scope='module')
def dups():
    dates = [datetime(2000, 1, 2), datetime(2000, 1, 2),
             datetime(2000, 1, 2), datetime(2000, 1, 3),
             datetime(2000, 1, 3), datetime(2000, 1, 3),
             datetime(2000, 1, 4), datetime(2000, 1, 4),
             datetime(2000, 1, 4), datetime(2000, 1, 5)]

    return Series(np.random.randn(len(dates)), index=dates)

def test_index_unique(dups):
        uniques = dups.index.unique()
        expected = DatetimeIndex([datetime(2000, 1, 2), datetime(2000, 1, 3),
                                  datetime(2000, 1, 4), datetime(2000, 1, 5)])
        assert uniques.dtype == 'M8[ns]'  # sanity
       tm.assert_index_equal(uniques, expected)

In all of the runs where this fails, the output shows that dups.index includes datetime(2000, 1, 6), which shouldn't be there according to the fixture.

Below in test_duplicate_dates_indexing the test sets ts[datetime(2000, 1, 6)] = 0 which, if the fixture is re-using the same object, would explain it. It looks like we just recently started randomizing the order of the tests, which would explain this.

@simonjayhawkins
Copy link
Member

Below in test_duplicate_dates_indexing the test sets ts[datetime(2000, 1, 6)] = 0 which, if the fixture is re-using the same object, would explain it.

scope='module' means the fixture is created once per module and reused. The default is per test function.

using scope='module' or even scope='session' could be a potential benefit if we had immutable DataFrames.

for the moment though we probably shouldn't be using scope on fixtures.

This was referenced Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unreliable Test Unit tests that occasionally fail
Projects
None yet
Development

No branches or pull requests

2 participants