-
Notifications
You must be signed in to change notification settings - Fork 69
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
tests failings with (signal: 6, SIGABRT: process abort signal) #491
Comments
The |
I encounted similar problems. Though I don't know whether it related to this issue or not, but after some investigation about that, Are there some mistakes in this test? #[cfg(test)]
use mockall::automock;
struct Foo {}
#[cfg_attr(test, automock)]
impl Foo {
pub fn hello() { () }
}
#[cfg(test)]
mod t {
use super::*;
#[test]
fn test_use_foo() {
let ctx = MockFoo::hello_context();
ctx.expect().times(0).return_const(());
MockFoo::hello();
}
}
|
PR #443 ensured that static methods' expectations would be cleared on Drop. But it was only tested for methods that paniced due to too few method calls. For methods with too many calls it actually introduced a double-panic. Double panics are bad; they lead to processes getting SIGABRT. This was a regression in Mockall 0.11.4. Fixes #491
I have some mock tests, and everytime I am experimenting with an expectation like something which might or might not be the tests fail... with
(signal: 6, SIGABRT: process abort signal)
link to the tests https://github.com/metalbear-co/mirrord/blob/main/mirrord/agent/src/steal/ip_tables.rs#L193
for more context, i made some changes to the function that takes in the mock object, i.e. the trait being mocked will have more calls to its functions, now when I add an expectation it just fails with the error i described the SIGABRT or errors without giving me context, as to how my added expectation is different from the one which the function being expected was called?
the failure has
???
i would expect to know how the expectation is different..Am i missing something? any macros that i should add?
The text was updated successfully, but these errors were encountered: