rock-gazebo / simulation-rock_gazebo

Main package that deals with the integration of Rock and Gazebo
Other
0 stars 1 forks source link

fix(test): read state using an explicit state reader #40

Closed doudou closed 2 years ago

doudou commented 2 years ago

orocos.rb's interface is ... fragile.

TaskContext#state will pull all read state changes and only return the last. One needs to do TaskContext#state(false) to only get the last state instead.

During the tests, it meant that we were dependent on the specific error to be read before EXCEPTION arrived.

rodrigoleonello commented 2 years ago

@doudou Just to confirm if I understood... As the TaskContext#state just return the last state, so maybe we would have a fail state in the stack of all read states changed that we can not get in the test, since we were checking the TaskContext#state instead the state indeed?

doudou commented 2 years ago

Exactly that. We would get a following state (e.g. EXCEPTION) instead of the one we were checking. Unit tests using Syskit do not have this problem as we look for events (Syskit already processes the queue for us)