-
Notifications
You must be signed in to change notification settings - Fork 40
Fix handling of ignore
in wait() and wait_with_all()
#82
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
Conversation
to see the tests fail with the old code, check out this branch, then undo the changes to src/child.rs, e.g.
|
let other_children_res = Self::wait_children(&mut self.children); | ||
|
||
self.ignore_error | ||
.then_some(Ok(())) |
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 is precise and thanks for the clean up.
assert!(run_fun!(false | true).is_ok()); | ||
set_pipefail(true); | ||
// test `ignore` command and pipefail mode | ||
// FIXME: make set_pipefail() thread safe, then move this to a separate test_ignore_and_pipefail() |
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.
Have you thought about using sealed_test to make the tests work ? Or we can make the CI to run tests sequentially
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.
we could do that, but i think it’s possible to fix the thread unsafety, and doing so would make the API more reliable. i’ll do that in a separate patch.
the logic in CmdChildren and FunChildren is currently a bit organic and inconsistent. as a result, the following test cases (also added in this patch) return the wrong results:
this patch fixes wait() and wait_with_all() to correctly handle
ignore
. it also adds a comprehensive test suite that verifies that all of the ways you can get a CmdResult or FunResult (“entry points”) correctly handle theignore
command and pipefail mode. note that: