Skip to content

Flaky apply test #23741

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
TomAugspurger opened this issue Nov 16, 2018 · 1 comment
Closed

Flaky apply test #23741

TomAugspurger opened this issue Nov 16, 2018 · 1 comment
Labels
Unreliable Test Unit tests that occasionally fail

Comments

@TomAugspurger
Copy link
Contributor

================================== 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.

@TomAugspurger TomAugspurger added the Unreliable Test Unit tests that occasionally fail label Nov 16, 2018
@mroeschke
Copy link
Member

We addressed this in #24307. I think eventually it was more of a timeout issue #23849.

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