[tests] clean up stale otbr-agent processes in ncp_mode runner#3386
Merged
Conversation
Clean up any stale, orphan `otbr-agent` processes at the start of each expect script loop in the `ncp_mode` test runner. Under POSIX expect test execution, the `spawn` command launches the `otbr-agent` as `sudo` (running as root). If the expect script exits, the child process can sometimes be orphaned instead of terminated. This leaves the `otbr-agent` alive on the host system and holding ownership of the `io.openthread.BorderRouter.wpan0` D-Bus name. In subsequent test scripts, the newly launched `otbr-agent` is unable to claim the D-Bus name, and all D-Bus requests are forwarded to the orphan `otbr-agent` process. Since its co-processor has been killed, the orphan agent hangs and subsequent `.Join` and properties `Get` method calls fail with a `NoReply` timeout. Explicitly killing `otbr-agent` between test scripts prevents stale process leakage and resolves D-Bus communication timeouts.
74eade2 to
6dfe367
Compare
Member
Author
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the tests/scripts/ncp_mode script to ensure that the OTBR_AGENT process is terminated during cleanup alongside other OpenThread processes. There are no review comments to address, and I have no further feedback to provide.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3386 +/- ##
==========================================
- Coverage 55.77% 45.97% -9.81%
==========================================
Files 87 143 +56
Lines 6890 17236 +10346
Branches 0 1412 +1412
==========================================
+ Hits 3843 7924 +4081
- Misses 3047 8746 +5699
- Partials 0 566 +566 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
abtink
approved these changes
May 29, 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.
Clean up any stale, orphan
otbr-agentprocesses at the start of each expect script loop in thencp_modetest runner.Under POSIX expect test execution, the
spawncommand launches theotbr-agentassudo(running as root). If the expect script exits, the child process can sometimes be orphaned instead of terminated. This leaves theotbr-agentalive on the host system and holding ownership of theio.openthread.BorderRouter.wpan0D-Bus name.In subsequent test scripts, the newly launched
otbr-agentis unable to claim the D-Bus name, and all D-Bus requests are forwarded to the orphanotbr-agentprocess. Since its co-processor has been killed, the orphan agent hangs and subsequent.Joinand propertiesGetmethod calls fail with aNoReplytimeout.Explicitly killing
otbr-agentbetween test scripts prevents stale process leakage and resolves D-Bus communication timeouts.