Add bulk transfer test to check_one_way_stream

Open Beginner friendly
#813 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
testing-qa

Research direction

Find the check_one_way_stream and do_receive_some helpers, then compare them with the individual bulk-transfer tests in test_*_pipes.py and any SocketStream tests. Verify how max_bytes is used and add coverage showing that a large chunk transfers correctly. The work is done when the shared check catches bulk-transfer problems and redundant tests are identified for possible removal.

Written by the indexing model from the issue text.

Description

polish

It turns out that currently, check_one_way_stream never attempts to transfer more than 1 byte at a time. In fact, the do_receive_some helper takes a max_bytes parameter, but ignores it and calls receive_some(1) anyway (whoops).

(This was discovered while reviewing the subprocess support PR, see https://github.com/python-trio/trio/pull/791#issuecomment-449480426)

This is not so great, because in many stream implementations, bulk transfers involve different logic than single-byte transfers (due to filling up receive buffers, partial sends, etc.). check_one_way_stream should try sending a big chunk of data and making sure it gets through correctly.

There are individual versions of this test in test_*_pipes.py, and probably elsewhere too (maybe in the SocketStream tests). If these become redundant we can drop them to speed up the test suite.

Dominant language
Python
Stars
7.3k
Forks
432
Avg merge
2d 17h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-trio/trio

All issues in python-trio/trio

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.