Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix static sequences #304

Conversation

sinback
Copy link
Contributor

@sinback sinback commented Nov 5, 2020

My team noticed a new bug in Sequence execution when we were upgrading py_trees from a version pre-2.0.15 to the current one. I added what seems to be a sensible change and two tests which show how it was broken before.

I noticed that prior to this change, if, for example, you tried to execute a static sequence of two behaviours that both succeed, you'd execute the first behaviour, then set current_child to the second behaviour, then execute the first behaviour, and set current_child to the second behaviour, then you'd be done because the main itertools iteration over the list of children would be done. However, after the change, with the sequence of two behaviours, you execute the first behaviour, set current_child to the second behaviour, then execute the second behaviour, try to set current_child to be the third behaviour, then hit the IndexError and pass, and still realize you were done because your itertools iteration is up.

@stonier stonier self-assigned this Nov 6, 2020
@stonier stonier added this to the 2.1 - Foxy milestone Nov 6, 2020
@stonier stonier merged commit 88cb91d into splintered-reality:devel Nov 6, 2020
@stonier
Copy link
Member

stonier commented Nov 6, 2020

Ooh, that was a slip, nice catch! Thanks also for the easy-to-reproduce examples as tests!

For historical reference, error was brought in with PR #289.

@stonier
Copy link
Member

stonier commented Nov 6, 2020

Released in v2.1.2.

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