Skip to content

Fix flaky tests - #1685

Merged
mattiaswal merged 3 commits into
mainfrom
flaky-tests
Oct 5, 2026
Merged

mattiaswal merged 3 commits into
mainfrom
flaky-tests

Conversation

@troglobit

@troglobit troglobit commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR aims to correct:

  • New tests for /system/advanced configuration have started to exhibit flaky behavior
  • Old DHCP server test: static host

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

runsh() hides ssh's own errors, so when ssh could not connect right
after the previous test rebooted the DUT, the first read came back
empty and the test reported /etc/default/chronyd as missing.  The
removal check had the opposite problem: a failed connection passed as
a removed file.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
runsh() hides ssh's own errors, so a failed connection after the reboot
read as an empty script list, and the check that the disabled script
did not run passed on a failed connection.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
troglobit requested review from mattiaswal and a balanced review from Copilot October 4, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused changes correctly use the retry helper for idempotent SSH operations.

Review effort: Balanced
Findings: None

What changed in this PR

Updates /system/advanced tests to tolerate transient SSH transport failures.

Changes:

  • Uses run_retry() for idempotent remote checks.
  • Validates missing files with exit code 1.
File Description
test/​case/​system/​rc_d/​test.py Makes rc.d verification retry transient SSH failures.
test/​case/​system/​etc_default/​test.py Makes default-file checks retry transient SSH failures.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

With all three DUTs configured at once, a client could send its three
discovers before the server answered, then back off for 30 seconds,
longer than the test waits for the lease.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@mattiaswal
mattiaswal merged commit 4423ae0 into main Oct 5, 2026
9 checks passed
@mattiaswal
mattiaswal deleted the flaky-tests branch October 5, 2026 07:19
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.

3 participants