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

syskit misses orogen state updates during exceptions #251

Open
g-arjones opened this issue May 26, 2020 · 1 comment
Open

syskit misses orogen state updates during exceptions #251

g-arjones opened this issue May 26, 2020 · 1 comment

Comments

@g-arjones
Copy link
Contributor

I caught this while testing a component so I'm not sure whether it happens in "runtime" as well. The component code is:

void Task::updateHook() {
    if (!doStuff()) { // <- may set an "emergency" internal state
        throw myException();
    }
}

void Task::stopHook() {
    if (hasEmergency()) {
        exception(EMERGENCY);
    }
}

Test code:

expect_execution { send_stuff_to_task }
    .to { emit task.emergency_state }

The behavior is not deterministic, sometimes it passes, sometimes it doesn't. If I try to catch exception_state rather than emergency_state then it passes consistently. Asserting task.orogen_state is also not deterministic, it varies between :EXCEPTION and :EMERGENCY

@g-arjones
Copy link
Contributor Author

g-arjones commented May 26, 2020

assert_equal :EMERGENCY, task.orocos_task.state

Passes consistently.

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

No branches or pull requests

1 participant