Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Swap arguments
  • Loading branch information
Nikki St Onge committed Oct 16, 2017
commit 3523ff6778e3f4e54cecf170d5c6a3320cafcae1
2 changes: 1 addition & 1 deletion test/internet/test-dgram-broadcast-multi-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ if (process.argv[2] !== 'child') {
count,
messages.length,
'A worker received an invalid multicast message. ' +
`Received ${messages.length} and wanted ${count}.`
`Received ${count} and wanted ${messages.length}.`
Copy link
Copy Markdown
Member

@lpinca lpinca Oct 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikkistonge sorry to pester, but I think the message is still misleading.

If you look at the code, the above assertion is run only when all workers have received all the messages. After that the test validates that each message received by the workers matches the original using a counter for each worker. If the count does not match the assertion throws.

My point is that the "Received x and wanted y." feedback is wrong as all messages have actually been received but one ore more of them is invalid/corrupted.

If you could just refactor this into assert.strictEqual(count, messages.length); that would be 10/10 imho as this will remove any possible confusion by using the default error message.

Thanks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok changed, now it will use default message :)

);
});

Expand Down