-
Notifications
You must be signed in to change notification settings - Fork 7
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: call env.stop() on finish #2
Conversation
Signed-off-by: Ruihang Xia <[email protected]>
src/runner.rs
Outdated
@@ -124,6 +124,9 @@ impl<E: Environment> Runner<E> { | |||
start.elapsed().as_millis() | |||
); | |||
|
|||
// stop this env | |||
self.env.stop(&env, db).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stop
won't be called if any error happens before this line. Maybe we should ensure that this stop
will always be executed after L92 the start
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
stop
won't be called if any error happens before this line. Maybe we should ensure that thisstop
will always be executed after L92 thestart
is called.
Makes sense. Maybe I should put it into a guardian.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I move start()
and stop()
out of run_env()
in 1e456a9, which should prevent stop()
from ignoring by early return. Please check it out!
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will merge this since original issue has been resolved, thanks
Much appreciated |
Oops the merge method seems not to be "squash". Could you help to config it @jiacai2050? I don't have enough permission. |
Done |
Signed-off-by: Ruihang Xia [email protected]
Changes Included
I forgot to call
stop()
on one env run finished. It may leave the started test target running and fail the next run. This patch fixes it.