test: Add MC/DC tests for loop pattern detector (stuck_detector)#11600
Merged
enyst merged 10 commits intoOpenHands:mainfrom Dec 29, 2025
Merged
test: Add MC/DC tests for loop pattern detector (stuck_detector)#11600enyst merged 10 commits intoOpenHands:mainfrom
enyst merged 10 commits intoOpenHands:mainfrom
Conversation
enyst
reviewed
Nov 1, 2025
enyst
reviewed
Nov 1, 2025
enyst
reviewed
Nov 1, 2025
Collaborator
enyst
left a comment
There was a problem hiding this comment.
Thank you, this is very helpful!
Collaborator
|
@phenric26 any interest in addressing the comments left by enyst? |
Collaborator
|
@OpenHands Understand the goal of this PR.
|
|
I'm on it! enyst can track my progress at all-hands.dev |
… lint - Move mocks and imports to module top-level - Deduplicate with existing pattern test and keep consistent naming - Format per ruff Co-authored-by: openhands <openhands@all-hands.dev>
1a2ed86 to
4ce47d0
Compare
- Translate non-English comments to English - Replace terse test symbols (Ap/Ai/etc.) with descriptive names - Use action_x/obs_x phrasing in inline comments - Prune redundant index-variant tests; keep guards and ignore-behavior tests - Focus on _is_stuck_action_observation_pattern behavior Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
|
Hey @enyst , this has been open for a while, if you're reviewing could you take another look? |
enyst
reviewed
Dec 29, 2025
- Fix D205: Add blank line between summary line and description in docstring - Remove extra blank lines between test methods (E303) Co-authored-by: openhands <openhands@all-hands.dev>
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.
Summary of PR
This PR enhances the robustness and test coverage of the StuckDetector by adding 6 new unit test cases for the _is_stuck_action_observation_pattern method.
Why this is needed: The existing test for this method only covered the "happy path" (the A-B-A-B pattern being successfully detected). The complex boolean logic in the D1 (len_check) and D2 (actions_equal) decisions was not being tested for independent failures.
These new tests implement Modified Condition/Decision Coverage (MC/DC), ensuring that each condition (CD1 through CD6) is shown to independently affect the decision's outcome.
Summary of Changes:
Result: All tests (new and old) are passing. The test count in the test_stuck.py file has increased from 22 to 28, confirming the robustness of the loop detection logic.
Change Type
Checklist
Fixes
Resolves #11599