Skip to content

coverage: give the disconnect test something to disconnect - #514

Merged
martin-belanger merged 1 commit into
linux-nvme:mainfrom
martin-belanger:coverage-disconnect-test
Sep 1, 2026
Merged

coverage: give the disconnect test something to disconnect#514
martin-belanger merged 1 commit into
linux-nvme:mainfrom
martin-belanger:coverage-disconnect-test

Conversation

@martin-belanger

Copy link
Copy Markdown
Collaborator

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.

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

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.11%. Comparing base (a16f9cc) to head (c2fd21c).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martin-belanger
martin-belanger merged commit b35450c into linux-nvme:main Sep 1, 2026
12 checks passed
@martin-belanger
martin-belanger deleted the coverage-disconnect-test branch September 1, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant