Skip to content

Flaky apply test #23741

Closed
Closed
@TomAugspurger

Description

@TomAugspurger
================================== FAILURES ===================================
______________ TestDataFrameAggregate.test_frequency_is_original ______________
[gw0] win32 -- Python 3.6.6 C:\Miniconda\envs\pandas\python.exe

self = <pandas.tests.frame.test_apply.TestDataFrameAggregate object at 0x0000021524503588>

    @given(index=indices(max_length=5), num_columns=integers(0, 5))
>   def test_frequency_is_original(self, index, num_columns):

pandas\tests\frame\test_apply.py:1160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda\envs\pandas\lib\site-packages\hypothesis\core.py:615: in execute
    ) % (test.__name__, text_repr[0],))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <hypothesis.core.StateForActualGivenExecution object at 0x0000021524503940>
message = "Hypothesis test_frequency_is_original(self=<pandas.tests.frame.test_apply.TestDataFrameAggregate at 0x21524503588>, i...', freq=None), num_columns=2) produces unreliable results: Falsified on the first call but did not on a subsequent one"

    def __flaky(self, message):
        if len(self.falsifying_examples) <= 1:
>           raise Flaky(message)
E           hypothesis.errors.Flaky: Hypothesis test_frequency_is_original(self=<pandas.tests.frame.test_apply.TestDataFrameAggregate at 0x21524503588>, index=DatetimeIndex(['1997-05-10'], dtype='datetime64[ns]', freq=None), num_columns=2) produces unreliable results: Falsified on the first call but did not on a subsequent one

C:\Miniconda\envs\pandas\lib\site-packages\hypothesis\core.py:874: Flaky
--------------------------------- Hypothesis ----------------------------------
Falsifying example: test_frequency_is_original(self=<pandas.tests.frame.test_apply.TestDataFrameAggregate at 0x21524503588>, index=DatetimeIndex(['1997-05-10'], dtype='datetime64[ns]', freq=None), num_columns=2)
Unreliable test timings! On an initial run, this test took 625.00ms, which exceeded the deadline of 500.00ms, but on a subsequent run it took 0.00 ms, which did not. If you expect this sort of variability in your test timings, consider turning deadlines off for this test by setting deadline=None.

You can reproduce this example by temporarily adding @reproduce_failure('3.59.1', b'AAAAA8YBBAI=') as a decorator on your test case

Is this a turning up a real bug?

    @given(index=indices(max_length=5), num_columns=integers(0, 5))
    def test_frequency_is_original(self, index, num_columns):
        # GH 22150
        original = index.copy()
        df = DataFrame(True, index=index, columns=range(num_columns))
        df.apply(lambda x: x)
        assert index.freq == original.freq

I haven't been able to reproduce locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unreliable TestUnit tests that occasionally fail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions