-
Notifications
You must be signed in to change notification settings - Fork 34
phd-runner option to defer guest cleanup on failure #1088
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,8 +101,18 @@ pub async fn run_tests_with_ctx( | |
| let framework = ctx.clone(); | ||
| let tc = execution.tc; | ||
| let mut sigint_rx_task = sigint_rx.clone(); | ||
| let mut test_ctx = framework.test_ctx(tc.fully_qualified_name()); | ||
| let mut success_tx = None; | ||
| if run_opts.manual_stop_on_failure { | ||
| let sigint_rx_cleanup = sigint_rx.clone(); | ||
| let (tx, success_rx) = watch::channel(None); | ||
| test_ctx.set_cleanup_task_outcome_receiver( | ||
| success_rx, | ||
| sigint_rx_cleanup, | ||
| ); | ||
| success_tx = Some(tx); | ||
| } | ||
| let test_outcome = tokio::spawn(async move { | ||
| let test_ctx = framework.test_ctx(tc.fully_qualified_name()); | ||
| tokio::select! { | ||
| // Ensure interrupt signals are always handled instead of | ||
| // continuing to run the test. | ||
|
|
@@ -144,6 +154,13 @@ pub async fn run_tests_with_ctx( | |
| } | ||
| ); | ||
|
|
||
| if let Some(tx) = success_tx { | ||
| let succeeded = !matches!(&test_outcome, TestOutcome::Failed(_)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (also if you clone the outcome and send that along it instead of just failed-or-not, might be nice to have "test failed because ..." as part of the prelude to a particular VM's informational blurb? might get too wordy. also not really attached to this idea as much as it'd be nice to distinguish the receivers versus the "is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in my experience the cause of the failure is usually right above this message in the log, so i didn't feel a particular pull to pass it along, but i definitely wouldn't be opposed if you can think of a case for it |
||
| if let Err(e) = tx.send(Some(succeeded)) { | ||
| error!("Error sending outcome to instance cleanup tasks: {e}"); | ||
|
lifning marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
|
|
||
| match test_outcome { | ||
| TestOutcome::Passed => stats.tests_passed += 1, | ||
| TestOutcome::Failed(_) => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.