Skip to content

[nexus] migrate test_reset to Nexus#12971

Merged
jwhui merged 1 commit into
openthread:mainfrom
jwhui:nexus-reset
Apr 27, 2026
Merged

[nexus] migrate test_reset to Nexus#12971
jwhui merged 1 commit into
openthread:mainfrom
jwhui:nexus-reset

Conversation

@jwhui
Copy link
Copy Markdown
Member

@jwhui jwhui commented Apr 23, 2026

Migrate legacy Python test test_reset.py to Nexus C++ test test_reset.cpp.

The test verifies that OpenThread correctly recovers network state, specifically frame counters and datasets, after sequential resets of nodes in a multi-hop topology (Leader <-> Router <-> ED).

The test sequence:

  • Establish multi-hop topology: Leader <-> Router <-> ED.
  • Send 1010 pings from ED to Leader to advance the frame counter beyond the default storage threshold (1000).
  • Reset Leader, Router, and ED sequentially.
  • Verify end-to-end connectivity after resets, confirming that frame counters were correctly recovered from non-volatile storage.

Legacy tests/scripts/thread-cert/test_reset.py is removed as its functionality is now fully covered by the Nexus test.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request completes the migration of a legacy Python-based certification test to the C++ Nexus testing framework. The purpose of this change is to improve test performance and maintainability by leveraging the native Nexus environment for verifying network state recovery after node resets.

Highlights

  • Test Migration: Migrated the legacy Python test test_reset.py to a new C++ Nexus test test_reset.cpp.
  • Test Coverage: The new Nexus test verifies that OpenThread correctly recovers network state, including frame counters and datasets, after sequential node resets in a multi-hop topology.
  • Cleanup: Removed the legacy tests/scripts/thread-cert/test_reset.py file as its functionality is now fully covered by the new Nexus test.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

Merging #12971 into main

name branch text data bss total
ot-cli-ftd 5340cfa 483128 860 66548 550536
ea9a99a 483128 860 66548 550536
+/- +0 +0 +0 +0
ot-ncp-ftd 5340cfa 448948 764 61784 511496
ea9a99a 448948 764 61784 511496
+/- +0 +0 +0 +0
ot-cli-mtd 5340cfa 375120 764 50972 426856
ea9a99a 375120 764 50972 426856
+/- +0 +0 +0 +0
ot-ncp-mtd 5340cfa 356180 764 46240 403184
ea9a99a 356180 764 46240 403184
+/- +0 +0 +0 +0
ot-cli-ftd-br 5340cfa 599936 864 136732 737532
ea9a99a 599936 864 136732 737532
+/- +0 +0 +0 +0
ot-rcp 5340cfa 63344 568 20804 84716
ea9a99a 63344 568 20804 84716
+/- +0 +0 +0 +0
Library files
name branch text data bss total
libopenthread-ftd.a 5340cfa 251171 95 40327 291593
ea9a99a 251171 95 40327 291593
+/- +0 +0 +0 +0
libopenthread-cli-ftd.a 5340cfa 61765 0 8091 69856
ea9a99a 61765 0 8091 69856
+/- +0 +0 +0 +0
libopenthread-ncp-ftd.a 5340cfa 33583 0 5948 39531
ea9a99a 33583 0 5948 39531
+/- +0 +0 +0 +0
libopenthread-mtd.a 5340cfa 169779 0 24783 194562
ea9a99a 169779 0 24783 194562
+/- +0 +0 +0 +0
libopenthread-cli-mtd.a 5340cfa 41462 0 8059 49521
ea9a99a 41462 0 8059 49521
+/- +0 +0 +0 +0
libopenthread-ncp-mtd.a 5340cfa 25807 0 5948 31755
ea9a99a 25807 0 5948 31755
+/- +0 +0 +0 +0
libopenthread-ftd-br.a 5340cfa 368977 99 110471 479547
ea9a99a 368977 99 110471 479547
+/- +0 +0 +0 +0
libopenthread-cli-ftd-br.a 5340cfa 80972 0 8131 89103
ea9a99a 80972 0 8131 89103
+/- +0 +0 +0 +0
libopenthread-rcp.a 5340cfa 9946 0 5060 15006
ea9a99a 9946 0 5060 15006
+/- +0 +0 +0 +0
libopenthread-radio.a 5340cfa 19939 0 238 20177
ea9a99a 19939 0 238 20177
+/- +0 +0 +0 +0

Migrate legacy Python test `test_reset.py` to Nexus C++ test
`test_reset.cpp`.

The test verifies that OpenThread correctly recovers network state,
specifically frame counters and datasets, after sequential resets of
nodes in a multi-hop topology (Leader <-> Router <-> ED).

The test sequence:
- Establish multi-hop topology: Leader <-> Router <-> ED.
- Send 1010 pings from ED to Leader to advance the frame counter
  beyond the default storage threshold (1000).
- Reset Leader, Router, and ED sequentially.
- Verify end-to-end connectivity after resets, confirming that frame
  counters were correctly recovered from non-volatile storage.

Legacy `tests/scripts/thread-cert/test_reset.py` is removed as its
functionality is now fully covered by the Nexus test.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the Python-based reset test with a new C++ implementation using the Nexus framework. The test verifies that nodes correctly recover their frame counters from persistent storage after a sequential reset of the Leader, Router, and End Device. Feedback suggests optimizing the kAttachToRouterTime constant to reduce the overall simulation duration while still accounting for router upgrade jitter.

Comment thread tests/nexus/test_reset.cpp
@jwhui jwhui requested a review from abtink April 23, 2026 07:49
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.49%. Comparing base (5340cfa) to head (41dc8ef).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12971      +/-   ##
==========================================
- Coverage   72.68%   71.49%   -1.20%     
==========================================
  Files         697      661      -36     
  Lines      101152    94099    -7053     
==========================================
- Hits        73522    67272    -6250     
+ Misses      27630    26827     -803     

see 250 files with indirect coverage changes

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

@jwhui jwhui merged commit 419decf into openthread:main Apr 27, 2026
110 of 112 checks passed
@jwhui jwhui deleted the nexus-reset branch April 27, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants