Bug 1936524

Summary: h2 fails to test with hypothesis 6.6: hypothesis.errors.FailedHealthCheck
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-h2Assignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: eclipseo, python-sig
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-h2-4.0.0-3.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-09 15:15:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1902400    

Description Miro Hrončok 2021-03-08 16:58:45 UTC
This is the problem I get when I try to build h2 with hypothesis 6.6:

https://copr.fedorainfracloud.org/coprs/churchyard/hypothesis-6.6/package/python-h2/

E                               hypothesis.errors.FailedHealthCheck: test/test_flow_control_window.py::TestAutomaticFlowControl::test_mixing_update_forms uses the 'frame_factory' fixture, which is reset between function calls but not between test cases generated by `@given(...)`.  You can change it to a module- or session-scoped fixture if it is safe to reuse; if not we recommend using a context manager inside your test function.  See https://docs.pytest.org/en/latest/fixture.html#sharing-test-data for details on fixture scope.
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.function_scoped_fixture to the suppress_health_check settings for this test.

/usr/lib/python3.9/site-packages/hypothesis/extra/pytestplugin.py:198: FailedHealthCheck
=========================== short test summary info ============================
FAILED test/test_basic_logic.py::TestBasicClient::test_changing_max_frame_size
FAILED test/test_flow_control_window.py::TestAutomaticFlowControl::test_must_acknowledge_for_stream
FAILED test/test_flow_control_window.py::TestAutomaticFlowControl::test_cannot_acknowledge_less_than_zero
FAILED test/test_flow_control_window.py::TestAutomaticFlowControl::test_acknowledging_1024_bytes_when_empty_increments
FAILED test/test_flow_control_window.py::TestAutomaticFlowControl::test_connection_only_empty
FAILED test/test_flow_control_window.py::TestAutomaticFlowControl::test_mixing_update_forms

This seem to be the only problematic package. Let me know if we should postpone the upgrade.

Thanks.

Comment 1 Miro Hrončok 2021-03-08 17:22:17 UTC
The healthcheck is not relevant here, because h2 clearly knows about it:

        # We need to refresh the encoder because hypothesis has a problem with
        # integrating with py.test, meaning that we use the same frame factory
        # for all tests.
        # See https://github.com/HypothesisWorks/hypothesis-python/issues/377
        frame_factory.refresh_encoder()

I suggest disabling it is a way to go.

Comment 2 Miro Hrončok 2021-03-08 18:20:23 UTC
This should fix the build problem: https://github.com/python-hyper/h2/pull/1248

Comment 3 Robert-André Mauchin 🐧 2021-03-09 07:58:16 UTC
I've pushed the patch and tested it with your COPR. Let me know when to build it with Hypothesis 6.

Comment 4 Miro Hrončok 2021-03-09 10:11:50 UTC
Thanks. No need to rebuild with new hypothesis, but if you want to satisfy koschei, build it any time (even before hypothesis is updated).

Comment 5 Robert-André Mauchin 🐧 2021-03-09 10:17:00 UTC
(In reply to Miro Hrončok from comment #4)
> Thanks. No need to rebuild with new hypothesis, but if you want to satisfy
> koschei, build it any time (even before hypothesis is updated).

The patch you provided only works with Hypothesis 6.

Comment 6 Miro Hrončok 2021-03-09 10:20:05 UTC
> The patch you provided only works with Hypothesis 6.

Oh. Right, it works with 5.49, but we don't have this yet. Mea culpa. I'll build it once ready.

Comment 7 Fedora Update System 2021-03-09 15:15:47 UTC
FEDORA-2021-cd0c93012a has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.