Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
test: replace port in dgram cd address empty test#12929
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
Conversation
arturgvieira-zz commented May 9, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Trott commented May 10, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Is the added complexity here better than just keeping the test simple and moving to Also: At least technically, I don't think this gets rid of the port collision issue that |
Trott commented May 10, 2017
(Also: I would expect |
arturgvieira-zz commented May 10, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I appreciate the comments, either way, is fine with me also. I followed the algorithm from another test which is also on your list, commit d289678 , |
arturgvieira-zz commented May 10, 2017
@Trott Also corrected the missing newline at the end of the file. Nice catch. |
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.
Nit: missing new line at the end of file.
lpinca commented May 10, 2017
I'm not sure either, as @Trott said this doesn't completely remove port collisions and makes the test harder to grok. |
lpinca commented May 10, 2017
arturgvieira-zz commented May 10, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@lpinca Ok, I'll remove the changes and move the tests to sequential. |
arturgvieira-zz commented May 10, 2017
lpinca commented May 11, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
As I wrote in my last comment I think the test can be left as is. There is no need to move it sequential. client.send(buf,common.PORT,onMessage);The code above bind the socket on a random port. |
arturgvieira-zz commented May 11, 2017
I apologize, misunderstood your comment. I'll close the PR. |
lpinca commented May 11, 2017
No problem. Also wait for other collaborators feedback, maybe I am missing something :) |
arturgvieira-zz commented May 11, 2017
Sorry, I am super new. I'll reopen the PR. |
cjihrig commented May 11, 2017
It is possible for these dgram tests to bind to the port to prevent port collisions. The socket would end up sending to itself and just ignore the data. It adds pretty minimal complexity, and allows the tests to stay in parallel. |
lpinca commented May 11, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@arturgvieira, @cjihrig is suggesting something like this diff --git a/test/parallel/test-dgram-send-callback-buffer-empty-address.js b/test/parallel/test-dgram-send-callback-buffer-empty-address.js index 67e64d6bfe..5b3b1c41a1 100644 --- a/test/parallel/test-dgram-send-callback-buffer-empty-address.js+++ b/test/parallel/test-dgram-send-callback-buffer-empty-address.js@@ -14,4 +14,4 @@ const onMessage = common.mustCall(function(err, bytes){client.close()}); -client.send(buf, common.PORT, onMessage);+client.bind(0, () => client.send(buf, client.address().port, onMessage)); |
arturgvieira-zz commented May 11, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@lpinga Understood and it seems like a good way to go, I will go ahead and update the PRs making that change. |
Replaced common.PORT in the following test. test-dgram-send-callback-buffer-empty-address.js Ref: #12376
arturgvieira-zz commented May 11, 2017
@lpinca All done, updated the PRs with the change requested. |
| }); | ||
| client.send(buf,common.PORT,onMessage); | ||
| client.bind(0,()=>client.send(buf,client.address().port,onMessage)); |
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.
Probably a good idea to wrap the callback in common.mustCall().
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.
Not a bad idea. onMessage() is wrapped in a mustCall(), so in this case not strictly necessary. No strong preference.
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.
Ah, yeah, if onMessage is already wrapped then the additional wrapping suggested by me above is actually not needed.
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.
Yeah I also find common.mustCall() a bit redundant here which is the reason why I didn't suggest it in the first place.
lpinca commented May 12, 2017
lpinca commented May 22, 2017
Landed in 4c84734. |
Replace common.PORT with available port assigned by the operating system in test-dgram-send-callback-buffer-empty-address. PR-URL: #12929 Refs: #12376 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Replace common.PORT with available port assigned by the operating system in test-dgram-send-callback-buffer-empty-address. PR-URL: #12929 Refs: #12376 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Replace common.PORT with available port assigned by the operating system in test-dgram-send-callback-buffer-empty-address. PR-URL: #12929 Refs: #12376 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Replaced common.PORT in the following test.
test-dgram-send-callback-buffer-empty-address.js
Ref: #12376
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test dgram