Skip to content

Test generated client/server interactions with a state machine - #1348

Open
hakarrr wants to merge 2 commits into
python-hyper:masterfrom
hakarrr:master
Open

hakarrr wants to merge 2 commits into
python-hyper:masterfrom
hakarrr:master

Conversation

@hakarrr

@hakarrr hakarrr commented Nov 10, 2026 •

Copy link
Copy Markdown

Refs #365.

Add a bounded Hypothesis state machine that connects a client and server in memory. It generates request/response sequences across up to eight streams, including data, end-of-stream, trailers, resets, window settings and ping acknowledgments. Wire bytes are fragmented into 1-257-byte chunks before delivery, including automatic peer responses.

An application-side model checks delivered payloads, headers, stream-end/reset/trailer events and ping acknowledgments independently of the peers' internal state. The default run uses 100 examples of up to 50 steps. There are no sockets or product-code changes. This is an initial interaction harness, not exhaustive protocol coverage.

Validation on Linux:

  • Full suite on Python 3.11, 3.12, 3.13, 3.14 and 3.15: 1,685 passed on each (baseline: 1,684).
  • Python 3.13 statement and branch coverage: 100%.
  • Ruff, strict-bytes mypy, Sphinx with warnings as errors, package build/twine checks and check-manifest passed.
  • Existing asyncio example against h2spec v2.6.0: 146 passed, none skipped.
  • Seven temporary mutation probes each failed as expected when dropping DataReceived, StreamEnded, RequestReceived, ResponseReceived, StreamReset, PingAckReceived or TrailersReceived events. The probes are not included in this change.

hakarrr and others added 2 commits November 11, 2026 00:22
Exercise multiplexed request and response streams, fragmented wire delivery,
stream ends, trailers and resets, window settings and ping acknowledgments
against an independent application model.

Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Track expected and observed request/response trailers so a dropped or duplicated
TrailersReceived event fails the invariant, not only malformed contents.

Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant