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: call env.stop() on finish #2

Merged
merged 3 commits into from
Dec 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ impl<E: Environment> Runner<E> {
start.elapsed().as_millis()
);

// stop this env
self.env.stop(&env, db).await;
Copy link
Collaborator

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.

Copy link
Member Author

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.

Makes sense. Maybe I should put it into a guardian.

Copy link
Member Author

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!


if !diff_cases.is_empty() {
println!("Different cases:");
println!("{:#?}", diff_cases);
Expand Down