Fix oak functions integration test thread leak#3919
Conversation
|
If this no longer output the nextest warnings about leaks, please also update the example logs in https://github.com/project-oak/oak/blob/main/docs/development.md with a new valid run. |
| let response = client.invoke(b"xxxyyyzzz").await.expect("failed to invoke"); | ||
| assert_eq!(std::str::from_utf8(&response).unwrap(), "xxxyyyzzz"); | ||
|
|
||
| background.kill(); |
There was a problem hiding this comment.
Could we have this happen on Drop, instead of explicitly having to call it?
There was a problem hiding this comment.
I like the idea. Curiously the comment above function that returns this claims that this already happens (it doesn't).
We cannot implement this on the existing type Box<dyn Running> since it conflicts with the existing Drop implementation of Box. We could however accomplish this by returning a type of our own, similar to tokio::process::Command. Might be worth doing so, but it'd be a slightly larger of change to xtask.
There was a problem hiding this comment.
Went with a small solution that adds an extra struct for background tasks that implements the dropping. Ideally I think all tasks within xtask should be killed on drop. However implementing that may not be possible. The current solution will do for now.
done |
|
artifact_name = "oak_echo_enclave_app" |
|
artifact_name = "oak_restricted_kernel_bin" |
|
artifact_name = "oak_echo_raw_enclave_app" |
|
artifact_name = "stage0" |
|
artifact_name = "oak_restricted_kernel_simple_io_bin" |
|
artifact_name = "oak_functions_enclave_app" |
|
artifact_name = "quirk_echo_enclave_app" |
|
artifact_name = "oak_tensorflow_enclave_app" |
Issue introduced in #3884, closes #3891.