Skip to content

Propagate skipped conditions in IfThenElse and WhileDoElse - #1276

Open
mmporong wants to merge 1 commit into
BehaviorTree:masterfrom
mmporong:fix/skipped-control-conditions
Open

mmporong wants to merge 1 commit into
BehaviorTree:masterfrom
mmporong:fix/skipped-control-conditions

Conversation

@mmporong

@mmporong mmporong commented Oct 31, 2026 •

Copy link
Copy Markdown

Problem

When the condition child of IfThenElse or WhileDoElse returns SKIPPED, the control node falls through without selecting a branch. IfThenElse then throws its fallback logic_error, while WhileDoElse tries to return IDLE and raises a runtime error.

Change

Propagate SKIPPED after resetting the children, consistent with the other control nodes. Add focused tests that skip the condition and verify that neither branch runs.

Testing

  • Before the fix: both new tests failed with the exceptions above.
  • After the fix: both new tests pass.
  • Related IfThenElse and WhileDoElse tests: 22 passed.
  • Full CTest suite: 588 passed, 2 skipped, 0 failed.
  • git diff --check: passed.

pre-commit, clang-format, and clang-tidy-21 were not available in the local environment.

CI note

The macOS job fails Reactive.TestLogging because it observes four ticks while asserting at least five. The base-commit macOS run already fails the same assertion with 4 vs 5. The PR run passes the new skipped-condition regressions; the existing timing-sensitive logging test is unchanged by this patch.

This branch has not been deployed

No deployments
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.

1 participant