Repository navigation
Test closing a POSIX transport while it connects - #155
Open
Happyfield7 wants to merge 1 commit into
Open
Happyfield7 wants to merge 1 commit into
Happyfield7 wants to merge 1 commit into
Conversation
Happyfield7
force-pushed
the
test-close-during-connect
branch
from
November 20, 2026 22:44
6b235c5 to
094972e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #155 +/- ##
==========================================
+ Coverage 94.39% 94.48% +0.08%
==========================================
Files 25 25
Lines 4446 4446
==========================================
+ Hits 4197 4201 +4
+ Misses 249 245 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
PosixSerialTransport._connectreturns early when the transport is closed after the port is configured, soconnection_madeis never called on a closed transport. No test covers this branch; CI reaches it only whentest_async_linux_race_condition_connect_closehappens to hit that timing (1 of 3 local runs). Socodecov/projectgoes up or down by one line on unrelated PRs, as on #152.Change
A test in
tests/test_serial_posix.pycloses the transport right after_reconfigure_portreturns and checks that the protocol gets noconnection_madeorconnection_lost. It runs on a pty with the platform's transport class.Testing
The branch was covered in every run on macOS and Debian sid, and the test fails when the
is_closing()check is removed. Full suite passes on both.