Skip to content
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: refactor/cleanup a number of cluster tests #8261

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 24, 2016

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

test, cluster

Description of change

Some general refactoring / improvements to various cluster related tests:

  • Move shared code into common
  • Favor use of strictEqual
  • Add some missing common.mustCalls
  • Other general cleanup

@jasnell jasnell added cluster Issues and PRs related to the cluster subsystem. test Issues and PRs related to the tests. labels Aug 24, 2016
@@ -82,15 +79,15 @@ function worker() {
// Create udp socket and start listening.
var socket = dgram.createSocket('udp4');

socket.on('message', function(data, info) {
socket.on('message', common.mustCall((data, info) => {
received++;

// Every 10 messages, notify the master.
if (received == PACKETS_PER_WORKER) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Since you're already working nearby, maybe change == to ===?

@jasnell
Copy link
Member Author

jasnell commented Aug 24, 2016


//Kill process when worker is killed
cluster.on('exit', function() {
cluster.on('exit', common.mustCall(() => {
process.exit(0);
Copy link
Member

Choose a reason for hiding this comment

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

While you're here... I think process.exit(0) can be removed.

@santigimeno
Copy link
Member

The changes LGTM with a couple of comments / suggestions.

* Move shared code into common
* Favor use of strictEqual
* Add some missing common.mustCalls
* Other general cleanup
@jasnell
Copy link
Member Author

jasnell commented Aug 30, 2016

@santigimeno ... updated! PTAL!

@santigimeno
Copy link
Member

LGTM with one tiny comment that you can ignore. Thanks!

@jasnell
Copy link
Member Author

jasnell commented Aug 31, 2016

@jasnell
Copy link
Member Author

jasnell commented Aug 31, 2016

Trying again due to a build bot failure: https://ci.nodejs.org/job/node-test-pull-request/3913/

@jasnell
Copy link
Member Author

jasnell commented Sep 1, 2016

CI was green. woo!

jasnell added a commit that referenced this pull request Sep 1, 2016
* Move shared code into common
* Favor use of strictEqual
* Add some missing common.mustCalls
* Other general cleanup

PR-URL: #8261
Reviewed-By: Santiago Gimeno <[email protected]>
@jasnell
Copy link
Member Author

jasnell commented Sep 1, 2016

Landed in baa0ffd

@jasnell jasnell closed this Sep 1, 2016
@mhdawson
Copy link
Member

mhdawson commented Sep 1, 2016

Looking at the AIX runs I've seen a few failures of: parallel/test-cluster-dgram-1

I wonder if its related to this change ?

@jasnell
Copy link
Member Author

jasnell commented Sep 2, 2016

If the failures are new, entirely possible. Have a stack trace?

@mhdawson
Copy link
Member

mhdawson commented Sep 2, 2016

opened this issue to track #8380

mhdawson added a commit to mhdawson/io.js that referenced this pull request Sep 2, 2016
We've started to see frequent failures in
test/parallel/test-cluster-dgram-1.js on AIX since the refactoring
in nodejs#8261.  Revert changes
until we have time to investigate properly.
@Fishrock123 Fishrock123 mentioned this pull request Sep 6, 2016
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Sep 8, 2016
* Move shared code into common
* Favor use of strictEqual
* Add some missing common.mustCalls
* Other general cleanup

PR-URL: nodejs#8261
Reviewed-By: Santiago Gimeno <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Sep 9, 2016
* Move shared code into common
* Favor use of strictEqual
* Add some missing common.mustCalls
* Other general cleanup

PR-URL: #8261
Reviewed-By: Santiago Gimeno <[email protected]>
@MylesBorins
Copy link
Contributor

This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants