-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
test: remove timers from test-tls-socket-close #53019
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
test: remove timers from test-tls-socket-close #53019
Conversation
c679e6f to
5581681
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
| netSocket.destroy(); | ||
| assert.strictEqual(netSocket.destroyed, true); | ||
|
|
||
| setImmediate(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No common.mustCall here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have separate tests for setImmediate().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really get what you mean, common.mustCall wouldn't be there to validate setImmediate behavior, but to ensure the assertion are actually run. Anyway, it doesn't really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are testing that the callback of setImmediate() is called in other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not called if e.g. process.exit is called before it's picked up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no process.exit() in the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding common.mustCall would ensure we catch it if it was ever added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it only where it is needed given the current assumptions. If the logic changes there are other more places where it would be needed.
| let serverTlsSocket; | ||
| const tlsServer = tls.createServer({ cert, key }, (socket) => { | ||
| serverTlsSocket = socket; | ||
| socket.on('data', (chunk) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No common.mustCallAtLeast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, only one byte is sent by the other peer.
|
Landed in a81d833 |
Fixes: #49902 PR-URL: #53019 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: nodejs#49902 PR-URL: nodejs#53019 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: nodejs#49902 PR-URL: nodejs#53019 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #49902 PR-URL: #53019 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #49902 PR-URL: #53019 Reviewed-By: Antoine du Hamel <[email protected]>
Fixes: #49902