This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
tests: improve test-child-process-fork-dgram. #8045
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes test-child-process-fork-dgram on the SmartOS jenkins node.
Wait for child process to register event handlers on server UDP socket
before sending messages from the parent process.
Increase the number of total messages so that both the child and the
master process get a chance to handle at least one of them.
However, this PR looks like a hack for a test case that could fail at anytime depending on how the underlying platform decides to dispatch the messages to the child or the master.
What are we trying to test with this test case? Do we absolutely need both the child and the parent to always handle UDP messages? Could we remove the UDP 'message' event handler as soon as we receive one dgram in the child or the master, so that the one that did not receive a message yet will be the only one that can receive it? This would guarantee (well, as much as UDP can guarantee anything...) that both processes will receive at least one message.