Skip to content

Add a test for recursively deleting nested models#881

Open
XINJIANGMO wants to merge 1 commit intogazebosim:mainfrom
XINJIANGMO:fixbug-782
Open

Add a test for recursively deleting nested models#881
XINJIANGMO wants to merge 1 commit intogazebosim:mainfrom
XINJIANGMO:fixbug-782

Conversation

@XINJIANGMO
Copy link
Contributor

@XINJIANGMO XINJIANGMO commented Feb 23, 2026

🦟 Bug fix

Fixes #782

Summary

Add a test for gz-sim#3080 to avoid regressions of this bug.

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the fix (as needed)
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.

Signed-off-by: momo <2438833481@qq.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a regression test for a crash bug that occurred when recursively deleting nested models. The bug was originally reported in gz-sim#3080 and fixed in gz-physics#781. The test ensures that removing a parent model with multiple nested models, followed by attempting to remove the already-deleted nested models, doesn't cause a crash due to iterator invalidation.

Changes:

  • Added RemoveNestedModelCrash test to verify that removing nested models doesn't crash
  • Test creates 6 nested models within a parent model, removes the parent, then attempts to remove the already-removed nested models

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants