test: add http agent to executionAsyncResource#34966
Conversation
|
Isn't it needed to execute at least two http requests to the same server to see the diff between use of the dedicated agent versus the global agent? |
| server.listen(0, () => { | ||
| assert.strictEqual(executionAsyncResource(), hooked[executionAsyncId()]); | ||
|
|
||
| http.get({ agent, port: server.address().port }, () => { |
There was a problem hiding this comment.
Can you wrap all the callbacks that are supposed to be called exactly once in common.mustCall(), i.e. the ones to http.createServer(), server.listen() and http.get()? That ensures that the assertions here are actually run, instead of the test just passing because something led to the callbacks not being called. (That’s probably not going to realistically happen because a ton of other tests would fail is these things were broken, but it’s a good practice to add those checks in our tests.)
This comment has been minimized.
This comment has been minimized.
|
@psj-tar-gz Linter complains about a few findings. A rebase to current master is maybe also a good idea. |
4de4483 to
55f0830
Compare
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: nodejs#34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
|
Landed in 491855c |
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: #34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: #34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: #34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: #34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: nodejs#34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Refs: https://github.com/nodejs/node/blob/HEAD/test/async-hooks/test-async-exec-resource-http.js Signed-off-by: psj-tar-gz <[email protected]> PR-URL: nodejs#34966 Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
I added a testcase about executionAsyncResource with Http Agent.
Refs: https://github.com/nodejs/node/blob/master/test/async-hooks/test-async-exec-resource-http.js
Signed-off-by: psj-tar-gz [email protected]
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes