Conversation
If a after* hook fails after a failure in a before* hook or the test, the after hook error is going to be read first and tears down the test runner. This causes the actual error not to be visible anymore. This surfaces these again by hooking into mocha internals and ignoring the after* errors, if it comes after a former error. That way we know what actually fails. Downside is not knowing about teardown issues that are in addition to former issues, while that is in almost all cases not important. Hiding also seemed better than logging both to let us focus on the main problem area.
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: d053029 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8981cbf87d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
BenchmarksBenchmark execution time: 2026-04-29 12:35:51 Comparing candidate commit d053029 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1345 metrics, 94 unstable metrics. |
Overall package sizeSelf size: 5.67 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
If a after* hook fails after a failure in a before* hook or the test, the after hook error is going to be read first and tears down the test runner. This causes the actual error not to be visible anymore. This surfaces these again by hooking into mocha internals and ignoring the after* errors, if it comes after a former error. That way we know what actually fails. Downside is not knowing about teardown issues that are in addition to former issues, while that is in almost all cases not important. Hiding also seemed better than logging both to let us focus on the main problem area.
If a after* hook fails after a failure in a before* hook or the test, the after hook error is going to be read first and tears down the test runner. This causes the actual error not to be visible anymore. This surfaces these again by hooking into mocha internals and ignoring the after* errors, if it comes after a former error. That way we know what actually fails. Downside is not knowing about teardown issues that are in addition to former issues, while that is in almost all cases not important. Hiding also seemed better than logging both to let us focus on the main problem area.
If a after* hook fails after a failure in a before* hook or the test, the after hook error is going to be read first and tears down the test runner. This causes the actual error not to be visible anymore.
This surfaces these again by hooking into mocha internals and ignoring the after* errors, if it comes after a former error. That way we know what actually fails.
Downside is not knowing about teardown issues that are in addition to former issues, while that is in almost all cases not important.
Hiding also seemed better than logging both to let us focus on the main problem area.