agronholm / agronholm/anyio

Add tools for testing connectivity handling

Open
#561 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
2.5k
Forks
260
Avg merge
2d 8h
Merged PRs (30d)
19

Description

### Things to check first

- [X] I have searched the existing issues and didn't find my feature already requested there

### Feature description

I'm thinking of adding some sort of `MiddleMan` class which works as both listener and connector. Once it receives a connection, it would connect to the final destination (some service being tested, probably). The test code could then arbitrarily disconnect either, or both sides, or make them unresponsive to test how the code would fare in these situations.

Testing TLS connections like this is a tad more complicated, but completely doable.

This would be best paired with #151.

### Use case

It would be prudent for implementations of network protocols to be tested around their handling of disconnections, and this is not trivial to accomplish with existing tools.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing testing tools in AnyIO and the related issue #151; this issue names no specific files or tests. Establish the scope for a MiddleMan that can connect a received connection to a destination and control either side, including the stated TLS case, with tests covering disconnections and unresponsive peers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.