Skip to content

test: whitelist the expected modules in test-bootstrap-modules.js - #26531

Merged
richardlau merged 1 commit into
nodejs:masterfrom
richardlau:whitelist-bootstrap
Mar 13, 2019
Merged

test: whitelist the expected modules in test-bootstrap-modules.js#26531
richardlau merged 1 commit into
nodejs:masterfrom
richardlau:whitelist-bootstrap

Conversation

@richardlau

Copy link
Copy Markdown
Member

Be explicit on the modules that are expected to be found and add an
appropriate assertion failure message to help debug when the list
changes.

Fixes: #23884

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

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Mar 8, 2019
@richardlau

Copy link
Copy Markdown
MemberAuthor

This is a draft because I highly suspect it will fail --without-ssl and --without-intl builds and I won't be able to work on this further until after the weekend.

The list(s) of modules are what is currently there at the moment (basically I kept running with and without worker threads and added the modules shown in the assertion failure message until the test passed).

(As an aside I found the default assert.deepStrictEqual() message unhelpful for sets because it didn't show all the differences in one go.)

Comment threadtest/parallel/test-bootstrap-modules.js Outdated
@richardlau

This comment has been minimized.

@richardlau

This comment has been minimized.

@richardlau

Copy link
Copy Markdown
MemberAuthor

@richardlau
richardlau marked this pull request as ready for review March 11, 2019 01:06
@richardlau

Copy link
Copy Markdown
MemberAuthor

Pushed a small fixup. New CI is yellow: https://ci.nodejs.org/job/node-test-pull-request/21416/

This should be good to go, pending reviews.

@richardlau
richardlauforce-pushed the whitelist-bootstrap branch 2 times, most recently from 4c06af2 to 4ce459aCompareMarch 12, 2019 00:14
@richardlau

richardlau commented Mar 12, 2019

Copy link
Copy Markdown
MemberAuthor

Forced pushed to fix after recent changes (#26523 and #26513 (not shown below as Travis doesn't run coverage)) changed the list:

https://travis-ci.com/nodejs/node/jobs/184020354#L5847-L5868

=== release test-bootstrap-modules ===
Path: parallel/test-bootstrap-modules
assert.js:85
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: These modules were not loaded:
NativeModule async_hooks,
NativeModule internal/process/next_tick,
NativeModule internal/queue_microtask
These modules were unexpectedly loaded:
NativeModule internal/process/task_queues
at Object.<anonymous> (/home/travis/build/nodejs/node/test/parallel/test-bootstrap-modules.js:126:8)
at Module._compile (internal/modules/cjs/loader.js:813:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:824:10)
at Module.load (internal/modules/cjs/loader.js:680:32)
at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
at Function.Module._load (internal/modules/cjs/loader.js:604:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:876:12)
at internal/main/run_main_module.js:21:11
Command: out/Release/node --expose-internals /home/travis/build/nodejs/node/test/parallel/test-bootstrap-modules.js

Note that #26523 actually reduced the number of modules loaded (🎉), but didn't reduce the count in the version of test-bootstrap-modules.js prior to this PR.

@richardlau

Copy link
Copy Markdown
MemberAuthor

@rvagg

Copy link
Copy Markdown
Member

Sorry, I was reprovisioning a smartos17 machine when this was running. Submitted a resume @ https://ci.nodejs.org/job/node-test-commit-smartos/24405/

@refackrefack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

RSLGTM

@richardlaurichardlau added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 12, 2019
@richardlaurichardlau added wip Issues and PRs that are still a work in progress. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Mar 13, 2019
@richardlau

Copy link
Copy Markdown
MemberAuthor

Need to adjust the test for #26501 (comment).

@richardlau

Copy link
Copy Markdown
MemberAuthor

For posterity, these are the adjustments required:

-bash-4.2$ ./tools/test.py --worker test/parallel/test-bootstrap-modules.js=== release test-bootstrap-modules ===Path: parallel/test-bootstrap-modulesevents.js:174 throw er; // Unhandled 'error' event ^AssertionError [ERR_ASSERTION]: These modules were unexpectedly loaded: Internal Binding heap_utils, Internal Binding stream_wrap, Internal Binding uv, NativeModule internal/stream_base_commons at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-bootstrap-modules.js:123:8) at Module._compile (internal/modules/cjs/loader.js:813:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:824:10) at Module.load (internal/modules/cjs/loader.js:680:32) at tryModuleLoad (internal/modules/cjs/loader.js:612:12) at Function.Module._load (internal/modules/cjs/loader.js:604:3) at Function.Module.runMain (internal/modules/cjs/loader.js:876:12) at MessagePort.port.on (internal/main/worker_thread.js:119:25) at MessagePort.emit (events.js:198:13) at MessagePort.onmessage (internal/worker/io.js:69:8)Emitted 'error' event at: at Worker.[kOnErrorMessage] (internal/worker.js:147:10) at Worker.[kOnMessage] (internal/worker.js:157:37) at MessagePort.Worker.(anonymous function).on (internal/worker.js:90:57) at MessagePort.emit (events.js:198:13) at MessagePort.onmessage (internal/worker/io.js:69:8)Command: out/Release/node --expose-internals /home/users/riclau/sandbox/github/nodejs/tools/run-worker.js /home/users/riclau/sandbox/github/nodejs/test/parallel/test-bootstrap-modules.js[00:00|% 100|+ 0|- 1]: Done-bash-4.2$

@richardlaurichardlau removed the wip Issues and PRs that are still a work in progress. label Mar 13, 2019
@richardlau

richardlau commented Mar 13, 2019

Copy link
Copy Markdown
MemberAuthor

New CI: https://ci.nodejs.org/job/node-test-pull-request/21512/ (✔️)

Could I get another review? This test is obviously sensitive to bootstrap refactorings that have been going on and I have had to adjust the lists of modules in the test twice now as other PRs have landed (arguably those PRs should have been adjusting the test with or without the changes in this PR as they affected which modules are loaded by the bootstrap process).

@richardlaurichardlau added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 13, 2019
Be explicit on the modules that are expected to be loaded and add an
appropriate assertion failure message to help debug when the list
changes.
Fixes: nodejs#23884
PR-URL: nodejs#26531
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
@richardlau

Copy link
Copy Markdown
MemberAuthor

Landed in 0c1e93b.

@richardlau
richardlau merged commit 0c1e93b into nodejs:masterMar 13, 2019
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
Be explicit on the modules that are expected to be loaded and add an
appropriate assertion failure message to help debug when the list
changes.
Fixes: nodejs#23884
PR-URL: nodejs#26531
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
Be explicit on the modules that are expected to be loaded and add an
appropriate assertion failure message to help debug when the list
changes.
Fixes: #23884
PR-URL: #26531
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
@targostargos mentioned this pull request Mar 27, 2019
@richardlau
richardlau deleted the whitelist-bootstrap branch June 26, 2024 20:52
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: make parallel/test-bootstrap-modules easier to reason about

5 participants

@richardlau@nodejs-github-bot@rvagg@sam-github@refack