coverage: give the disconnect test something to disconnect - #514
Merged
martin-belanger merged 1 commit intoSep 1, 2026
Merged
Conversation
The script disconnects a controller out from under stas and watches the daemon notice and reconnect. It had not done that in a long time: the phase before it sets "ip-family=ipv6", nvmet listened on 0.0.0.0, and 127.0.0.1 is the only address it answered on. So the one reachable controller was filtered out by address family, every other entry in that configuration is unreachable by design, and get_device() found nothing. Both halves printed "Failed to find a connection" in red and skipped, while the run still reported success. nvmet listens on "::" instead. It accepts both families on the IPv6 wildcard but only IPv4 on the IPv4 one, so this is what the file's own commented-out alternative was for. The ipv6 phase now proves stas can connect over IPv6 rather than proving it cannot, which nothing else in the run covered. That costs the one connection the target used to refuse, so a controller pointed at port 8010 takes its place. Nothing listens there, which is a sturdier way to be refused than a family mismatch, and it keeps ECONNREFUSED covered. It has to be an IPv6 address: this phase would filter out 127.0.0.1 before ever attempting to connect. get_device() waits for a controller rather than sampling twice. One takes a moment to come up after a reload, and a parked discovery controller reports "nvme?" until its poll timer brings it back. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #514 +/- ##
=======================================
Coverage 69.11% 69.11%
=======================================
Files 16 16
Lines 2742 2742
=======================================
Hits 1895 1895
Misses 847 847 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
The script disconnects a controller out from under stas and watches the daemon notice and reconnect. It had not done that in a long time: the phase before it sets "ip-family=ipv6", nvmet listened on 0.0.0.0, and 127.0.0.1 is the only address it answered on. So the one reachable controller was filtered out by address family, every other entry in that configuration is unreachable by design, and get_device() found nothing. Both halves printed "Failed to find a connection" in red and skipped, while the run still reported success.
nvmet listens on "::" instead. It accepts both families on the IPv6 wildcard but only IPv4 on the IPv4 one, so this is what the file's own commented-out alternative was for. The ipv6 phase now proves stas can connect over IPv6 rather than proving it cannot, which nothing else in the run covered.
That costs the one connection the target used to refuse, so a controller pointed at port 8010 takes its place. Nothing listens there, which is a sturdier way to be refused than a family mismatch, and it keeps ECONNREFUSED covered. It has to be an IPv6 address: this phase would filter out 127.0.0.1 before ever attempting to connect.
get_device() waits for a controller rather than sampling twice. One takes a moment to come up after a reload, and a parked discovery controller reports "nvme?" until its poll timer brings it back.