Repository navigation
test(appsec): consolidate Express setup and teardown - #9875
Conversation
Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.
Overall package sizeSelf size: 8.25 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 445.14 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: b7b8064 | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9875 +/- ##
==========================================
- Coverage 98.54% 97.83% -0.72%
==========================================
Files 982 977 -5
Lines 145106 144954 -152
Branches 12799 12239 -560
==========================================
- Hits 143000 141811 -1189
- Misses 2106 3143 +1037 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 258bc609e8
ℹ️ 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-08-20 11:57:42 Comparing candidate commit b7b8064 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2282 metrics, 10 unstable metrics.
|
A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
* test(appsec): consolidate Express setup and teardown Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence. * test(appsec): await server listening events * test(appsec): protect cleanup from missing server A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
* test(appsec): consolidate Express setup and teardown Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence. * test(appsec): await server listening events * test(appsec): protect cleanup from missing server A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
* test(appsec): consolidate Express setup and teardown Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence. * test(appsec): await server listening events * test(appsec): protect cleanup from missing server A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
* test(appsec): consolidate Express setup and teardown Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence. * test(appsec): await server listening events * test(appsec): protect cleanup from missing server A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
What does this PR do?
Runs Express AppSec fixture setup and teardown through one ordered hook per phase.
Motivation
Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.