Skip to content

policy tests fail if there is a package.json in parent directories #35600

Description

@jasnell

Just opening this so it's not forgotten.... Policy tests can fail if there is a package.json in the parent path of the local node.js repo

Error [ERR_MANIFEST_ASSERT_INTEGRITY]: The content of "file:///home/james/package.json" does not match the expected integrity. The resource was not found in the policy.
    at new NodeError (node:internal/errors:258:15)
    at Manifest.assertIntegrity (node:internal/policy/manifest:532:19)
    at Object.read (node:internal/modules/package_json_reader:34:16)
    at readPackage (node:internal/modules/cjs/loader:259:36)
    at readPackageScope (node:internal/modules/cjs/loader:292:19)
    at shouldUseESMLoader (node:internal/modules/run_main:36:15)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:67:24)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_MANIFEST_ASSERT_INTEGRITY'
}

    at Object.<anonymous> (/home/james/node/node/test/parallel/test-policy-integrity-flag.js:64:10)
    at Module._compile (node:internal/modules/cjs/loader:1072:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1101:10)
    at Module.load (node:internal/modules/cjs/loader:937:32)
    at Function.Module._load (node:internal/modules/cjs/loader:778:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 1,
  expected: 0,
  operator: 'strictEqual'
}
Command: out/Release/node /home/james/node/node/test/parallel/test-policy-integrity-flag.js

What steps will reproduce the bug?

How often does it reproduce? Is there a required condition?

What is the expected behavior?

What do you see instead?

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    policyHistorical issues and PRs related to the removed policy-manifest feature.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