-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Async keywords are not stopped when execution is stopped gracefully #4808
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
Comments
Teardowns are, by default, executed when execution is gracefully stopped. If you don't want that, you can use the |
The problem is not that the teardown is executed. The problem is, that the async keyword in the test case is not stopped immediately before executing the teardown. In the example result of the post before, you can see the log messages of the test case keyword in the teardown after a graceful stop of the execution. Normal behaviour with graceful stop:
Current behaviour when using async keywords:
In my example in the post above, you can see the log message "Sleep Test" being logged in the teardown, although the execution was stopped and the testcase keyword should have been stopped immediately (only the teardown should be executed). |
I see. Apparently async methods would need separate handling to get them killed. Would be nice to get that fixed in RF 6.1.2. I'm on holiday and won't have time to look at this in the near future. If someone with more async knowledge would be interested to look at this already now that would be great. Ping @ygorpontelo. |
We can cancel the coroutines when we receive the graceful stop event. We can also check for running coroutines and better clean ups once we are stopping the run as well. I'll get to it as soon as i can. |
Sorry for forgetting about this. The PR looks good otherwise but we'd also need a test. I hope we could still get this into RF 7. |
After thinking this a bit more, the current behavior is buggy and we believe bugs should in general be fixed as soon as possible. I added this to RF 7 scope. Hopefully you @ygorpontelo can help with tests. Getting somewhat related #4803 into RF 7 would be good too. |
Fixed by PR #4835. Great work @ygorpontelo! |
Stop a test execution during an async keyword with SIGINT or CTRL+C. Now the teardown with async keywords is executed, but the test keyword still runs and is not stopped.
Example:
Test python library:
Test robot suite:
Result:
The text was updated successfully, but these errors were encountered: