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
Warnings from Test2::API during global destruction #827
Comments
of course adding |
done_testing signals the test internals that no more test events will happen and it is safe to output the final test count and other results, and safe for destruction to happen. Your There really is no way to protect against this, once Test::Builder/Test2 have started garbage collecting it is not safe to modify the state, which may not be around anymore to be modified. It might be possible to add a better message when it detects this has happened, something like "Attempt to send a test event after test state teardown", but that is still not super clear. Also it would be almost impossible to catch every place this kind of thing can happen. |
I just merged a change that makes the error message a lot more useful:
|
As showed by the perl script just after when running it, this raises warnings from Test2::API during Global destruction.
I can reproduce this behavior using
I tried to reduce it to a minimal script to trigger the warnings.
Note that removing a module, which can seem useless or duplicate would fix the issue, as I guess the global destruction will happen in a different order.
output when running using
Perl 5.28.0 with Test-Simple 1.302140
As shown above we are using
$hid
with anundefined
value as a hash key... we should probably check if it's defined or not... but this might cover a larger bug.The text was updated successfully, but these errors were encountered: