Skip to content

munet: fix desync after send/expect - #67

Merged
choppsv1 merged 1 commit into
LabNConsulting:mainfrom
liambrady:liambrady/newline_desync
Sep 29, 2025
Merged

choppsv1 merged 1 commit into
LabNConsulting:mainfrom
liambrady:liambrady/newline_desync

Conversation

@liambrady

@liambrady liambrady commented Jul 25, 2025 •

Copy link
Copy Markdown
Contributor

spawn() within shell_spawn() already provides a newline when no shell/login prompt is found. Sending a second newline after the expected prompt is detected results in a desync in the console I/O. This is because response received from sending the newline is not consumed.

Thus, any future instance after the desync of cmd_nostatus() or cmd_status() after shell_spawn() finishes either throws a warning or an error. The instability due to the desync can break following features that rely on such functionality, such as the mounting of shared volumes into the QEMU VM.

As a bonus, this also cleans up the output of the _console-log.txt files created for QEMU nodes. The I/O sequence is a lot easier to follow when there is no desync present.

@liambrady liambrady added the bug Something isn't working label Jul 25, 2025
@liambrady
liambrady force-pushed the liambrady/newline_desync branch from 6974934 to deb4593 Compare July 25, 2025 18:55
@liambrady
liambrady requested a review from choppsv1 July 25, 2025 18:56
@liambrady liambrady changed the title munet: fix send/expect desync munet: fix desync after send/expect Jul 25, 2025
@liambrady
liambrady force-pushed the liambrady/newline_desync branch from deb4593 to af608b3 Compare July 25, 2025 18:57
@codecov

codecov Bot commented Jul 25, 2025 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
- Coverage   60.12%   60.07%   -0.05%     
==========================================
  Files          19       19              
  Lines        5831     5829       -2     
==========================================
- Hits         3506     3502       -4     
- Misses       2325     2327       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@choppsv1
choppsv1 force-pushed the liambrady/newline_desync branch from af608b3 to d67db98 Compare September 29, 2025 19:36
spawn() within shell_spawn() already provides
a newline when no shell/login prompt is found.
Sending a second newline after the expected
prompt is detected results in a desync in the
console I/O. This is because the response
received from sending the newline is not
consumed.

Thus, any future instance after the desync
of cmd_nostatus() or cmd_status() after
shell_spawn() finishes either throws a
warning or fails. The instability due to
the desync can break following features that
rely on such functionality, such as the
mounting of shared volumes into the QEMU VM.

Signed-off-by: Liam Brady <lbrady@labn.net>
@choppsv1
choppsv1 force-pushed the liambrady/newline_desync branch from d67db98 to d611d46 Compare September 29, 2025 20:04
@choppsv1
choppsv1 merged commit 4f5284b into LabNConsulting:main Sep 29, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants