Repository navigation
Accept a split read in test_sync_read_timeout_with_partial_data - #157
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #157 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 25 25
Lines 4424 4426 +2
=======================================
+ Hits 4175 4177 +2
Misses 249 249 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
puddly
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
test_sync_read_timeout_with_partial_datachecks that a read with a timeout returns available data at once instead of waiting for the timeout: it writesb"hello", callsread(5)with a 1.0 s timeout and expects the result within 0.2 s. It also assumes the five bytes arrive together, which a relay does not guarantee.read()returns what has arrived, so when the data comes in two pieces the test fails although the port behaves correctly. This happened on #155's Windows Python 3.13 job on the RFC 2217 pair:assert b'hell' == b'hello'.Change
The test keeps its purpose: the first
read(5)must return a non-empty prefix ofb"hello"within 0.2 s. Any remaining bytes are then read withreadexactlyand the full payload is checked. No library change.Testing
The test passes on all pairs on macOS and Debian sid (100 of 100 runs on Linux), and the full suite passes on both. A simulated split on a pty (
hell, theno50 ms later) passes the new assertions and fails the old one. The real split only happens on the Windows hub4com pair, which runs in CI only.