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 beforeExit tests #10581

Closed
wants to merge 1 commit into from
Closed

Conversation

Trott
Copy link
Member

@Trott Trott commented Jan 3, 2017

Combine and rename tests for the beforeExit event on process.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test process

@Trott Trott added process Issues and PRs related to the process subsystem. test Issues and PRs related to the tests. labels Jan 3, 2017
@sam-github
Copy link
Contributor

There are only 43 tests with mixed/camelCase, 1204 with lower case.

I don't think mixed case is conventional, and I don't think its a good idea. Some file systems aren't case-sensitive, and in the test names that do have camelCase, I can't figure out any pattern as to why. As far as I can see, the choise of camelCase or dash-seperators is completely random/arbitrary, and not the most common naming convention.

@Fishrock123
Copy link
Contributor

Yeah let's leave it lowercase.

@Fishrock123
Copy link
Contributor

}));
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why nextTick is not tested here.

}));
}

const N = 5;
let n = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these be closed over or something? If we add more tests later, having top level variables would make them inconvenient I guess.

@sam-github
Copy link
Contributor

There are two dimensions of the tests: one is to test the various mechanisms to ensure they are dealt with (tick/timeout/net listen/etc.), the other is to test recursive use of a single mechanism.

There are lots of ways to refactor this, and there are dimensions not covered by the tests (not everything is done recursively), but in the absence of regressions, I don't know if anyone has the energy to write them all.

@Fishrock123
Copy link
Contributor

Actually after a second look I wonder if these shouldn't just be kept separate?

@Trott
Copy link
Member Author

Trott commented Jan 5, 2017

@sam-github Renamed the file so it is without mixed case. PTAL

Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.
@Trott
Copy link
Member Author

Trott commented Jan 5, 2017

@thefourtheye Block-scoped the N and n variables. PTAL

@Trott
Copy link
Member Author

Trott commented Jan 5, 2017

@Trott
Copy link
Member Author

Trott commented Jan 5, 2017

Only failure in CI is Jenkins/Hudson related. But this test ran and succeeded before the failure, so CI is effectively ✅

@Trott
Copy link
Member Author

Trott commented Jan 6, 2017

Landed in d2c96af

@Trott Trott closed this Jan 6, 2017
Trott added a commit that referenced this pull request Jan 6, 2017
Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

PR-URL: #10581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@sam-github
Copy link
Contributor

retroactive LGTM, @Trott , sorry, still digging out of my email

italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

PR-URL: nodejs#10581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 19, 2017
Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

PR-URL: nodejs#10581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
targos pushed a commit that referenced this pull request Jan 28, 2017
Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

PR-URL: #10581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

PR-URL: nodejs#10581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
Combine and rename tests for the `beforeExit` event on `process`.

The naming now more closely follows the de facto conventions of the
project.

The two tests were very similar and do not seem to benefit from being
separate.

PR-URL: nodejs#10581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@MylesBorins
Copy link
Contributor

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

@Trott Trott deleted the beforeExit branch January 13, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
process Issues and PRs related to the process subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants