python-hyper / hpack

HTTP/2 Header Encoding for Python
https://hpack.readthedocs.io/en/latest/
MIT License
72 stars 32 forks source link

Tests frequently fail hypothesis health checks #177

Closed mgorny closed 4 years ago

mgorny commented 4 years ago

I've attempted running tests with hypothesis 4.44.2 and they frequently fail with the following error:

==================================================================== FAILURES =====================================================================
________________________________________________________ TestDictToIterable.test_ordering _________________________________________________________

self = <test_hpack.TestDictToIterable object at 0x7faaa7cbce48>

    @given(
>       special_keys=sets(keys),
        boring_keys=sets(keys),
    )
    def test_ordering(self, special_keys, boring_keys):
        """
        _dict_to_iterable produces an iterable where all the keys beginning
        with a colon are emitted first.
E       hypothesis.errors.FailedHealthCheck: Data generation is extremely slow: Only produced 0 valid examples in 1.53 seconds (0 invalid ones and 2 exceeded maximum size). Try decreasing size of the data you're generating (with e.g.max_size or max_leaves parameters).
E       See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.too_slow to the suppress_health_check settings for this test.

test/test_hpack.py:753: FailedHealthCheck
------------------------------------------------------------------- Hypothesis --------------------------------------------------------------------
You can add @seed(41570203220120605597689971933743567532) to this test or run pytest with --hypothesis-seed=41570203220120605597689971933743567532 to reproduce this failure.
______________________________________________ TestDictToIterable.test_ordering_applies_to_encoding _______________________________________________

self = <test_hpack.TestDictToIterable object at 0x7faaa7cead30>

    @given(
>       special_keys=sets(keys),
        boring_keys=sets(keys),
    )
    def test_ordering_applies_to_encoding(self, special_keys, boring_keys):
        """
        When encoding a dictionary the special keys all appear first.
E       hypothesis.errors.FailedHealthCheck: Data generation is extremely slow: Only produced 7 valid examples in 1.65 seconds (3 invalid ones and 2 exceeded maximum size). Try decreasing size of the data you're generating (with e.g.max_size or max_leaves parameters).
E       See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.too_slow to the suppress_health_check settings for this test.

test/test_hpack.py:790: FailedHealthCheck
------------------------------------------------------------------- Hypothesis --------------------------------------------------------------------
You can add @seed(189963379516472093917678717077645948264) to this test or run pytest with --hypothesis-seed=189963379516472093917678717077645948264 to reproduce this failure.
======================================================= 2 failed, 82 passed in 7.63 seconds =======================================================
sethmlarson commented 4 years ago

Should be fixed in master.