Skip to content

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

Description

@refack
  • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky-testIssues and PRs involving tests that fail intermittently in CI.processIssues and PRs related to the process subsystem.testIssues and PRs related to Node.js core tests and test infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions