Open axelson opened 10 months ago
Because the process is dead, we really can't know if it is because there are no expectations defined or because its callers crashed. So the best we can do is to add more information to the error message saying that all of its callers are dead. And perhaps say that "no expectations found" instead of "no expectations defined". WDYT @whatyouhide?
Yeah there's not much we can do here, agreed. When the test process dies, we need to clear its expectations, so the task won't find any in its callers. I think the best we can do is to (maybe significantly) improve the error message. @axelson wanna make a PR? 🙃
I am interested in creating a PR for this, I've started one but haven't finished it yet.
@axelson fantastic! Let us know if we can help. Would love a PR absolutely 🙃
In the case where:
$callers
) is started from the test processA confusing error is raised. The error says that "no expectation defined for
<mock>
in process (or its callers)", but the given expectation was set in that processes callers. Here's an example error output for this case:Here's a git repo that reproduces the error: https://github.com/axelson/mox_repro
I have a suspicion that what is happening is that Mox is seeing that the test process has finished and clearing out the expectations.
Instead my ideal behavior would be to either keep the expectation valid or modify the error message to say that expectations against now dead processes are not valid.