Skip to content

Conversation

@dinophile
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Oct 6, 2017
@mscdexmscdex added the dgram Issues and PRs related to the dgram subsystem / UDP. label Oct 6, 2017
@TrottTrott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Oct 6, 2017
assert.strictEqual(count,messages.length,
'A worker received an invalid multicast message');
`A worker received an invalid multicast message:
Recieved ${messages.length}, should be ${count}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Recieved -> Received

Copy link
Member

@BridgeARBridgeAROct 7, 2017

Choose a reason for hiding this comment

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

Using multiline template strings is actually discouraged. This would add lots of extra whitespace to the error message. Please use this instead

'A worker received an invalid multicast message'+`Received ${messages.length}, should be ${count}`

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thank you! I didn't know about that, we do try to keep messages very short in our code base at work so I didn't know how to handle longer strings! Will fix!

@dinophile
Copy link
ContributorAuthor

Oh dear...I get caught by that 'i before e' rule when typing all the time! Thank you for the catch!

jasnell
jasnell previously approved these changes Oct 10, 2017
assert.strictEqual(count,messages.length,
'A worker received an invalid multicast message');
'A worker received an invalid multicast message'+
`Received ${messages.length}, should be ${count}`);
Copy link
Member

Choose a reason for hiding this comment

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

If I'm not wrong it should be the opposite: Received ${count}, should be ${messages.length}.
I also think it makes sense to remove the error message in favor of the default one.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I thought count is the expected number and messages.length is the actual number recieved? I'm actually away from my computer until the 23rd (on vacation!) So I can't take a look until then! But I agree taking out the error message would be a good idea!

Copy link
Member

Choose a reason for hiding this comment

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

No, it is actually the other way around.

Copy link
Member

Choose a reason for hiding this comment

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

Even if reversed the message is still misleading as the assertion is actually run when all messages are received by all workers, so my suggestion is to get rid of the message argument completely and use the default error message.

assert.strictEqual(count,messages.length);

Copy link
Member

Choose a reason for hiding this comment

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

See #15998 (comment). It's the same here.

@Trott
Copy link
Member

I went and fixed the nit from @lpinca. I think this is ready to go. PTAL.

CI: https://ci.nodejs.org/job/node-test-pull-request/11010/

@joyeecheung
Copy link
Member

@tniessen
Copy link
Member

Landed in 65b8d21, thank you! 🎉

tniessen pushed a commit that referenced this pull request Oct 28, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
gibfahn pushed a commit that referenced this pull request Oct 31, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
@gibfahngibfahn mentioned this pull request Oct 31, 2017
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
PR-URL: nodejs/node#15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
PR-URL: nodejs/node#15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
PR-URL: #15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
PR-URL: nodejs/node#15979 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.dgramIssues and PRs related to the dgram subsystem / UDP.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

12 participants

@dinophile@Trott@joyeecheung@tniessen@jasnell@lpinca@cjihrig@gireeshpunathil@BridgeAR@mscdex@MylesBorins@nodejs-github-bot