Skip to content

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

Closed
@refack

Description

  • Version: N/A
  • Platform: All
  • Subsystem: test,bootstrap

/* eslint-disable node-core/required-modules */
'use strict';
// Ordinarily test files must require('common') but that action causes
// the global console to be compiled, defeating the purpose of this test.
// This makes sure no additional files are added without carefully considering
// lazy loading. Please adjust the value if necessary.
const list = process.moduleLoadList.slice();
const assert = require('assert');
assert(list.length <= 78, list);

The test uses a magic number that can only be reasonably found empeericaly. That number also changes depending on what CLI parameters are used, or if run with a test harness.
Some suggestions for improvement have been:

  1. blacklist some modules that we know we don’t want to have loaded unconditionally, rather than set a fixed number. (@addaleax)
  2. Just reports from the CI or add something informative to the test runner output. (@devsnek)
  3. ???

Refs: #23876

Metadata

Assignees

No one assigned

    Labels

    flaky-testIssues and PRs related to the tests with unstable failures on the CI.processIssues and PRs related to the process subsystem.testIssues and PRs related to the tests.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions