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: parallel.test-module-loading-error fails on IBM i #48980

Closed
abmusse opened this issue Jul 31, 2023 · 3 comments
Closed

test: parallel.test-module-loading-error fails on IBM i #48980

abmusse opened this issue Jul 31, 2023 · 3 comments
Labels
ibm i Issues and PRs related to the IBM i platform. test Issues and PRs related to the tests.

Comments

@abmusse
Copy link
Contributor

abmusse commented Jul 31, 2023

Ref:

https://ci.nodejs.org/job/node-test-commit-ibmi/nodes=ibmi73-ppc64/1239/testReport/(root)/parallel/test_module_loading_error/

The test result does not give a detailed error message so here is the output from a console run

$ ./out/Release/node test/parallel/test-module-loading-error.js 
node:assert:635
      throw err;
      ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  Comparison {
+   code: 'MODULE_NOT_FOUND'
-   code: 'ERR_INVALID_PACKAGE_CONFIG'
  }
    at Object.<anonymous> (~/test/parallel/test-module-loading-error.js:90:8)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: Error: Cannot find module '../fixtures/packages/is-dir'
  Require stack:
  - ~/test/parallel/test-module-loading-error.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
      at Module._load (node:internal/modules/cjs/loader:901:27)
      at Module.require (node:internal/modules/cjs/loader:1115:19)
      at require (node:internal/modules/helpers:119:18)
      at assert.throws.common.isAIX.code (~/test/parallel/test-module-loading-error.js:91:11)
      at getActual (node:assert:756:5)
      at Function.throws (node:assert:902:24)
      at Object.<anonymous> (~/test/parallel/test-module-loading-error.js:90:8)
      at Module._compile (node:internal/modules/cjs/loader:1241:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1295:10) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '~/test/parallel/test-module-loading-error.js'
    ]
  },
  expected: { code: 'ERR_INVALID_PACKAGE_CONFIG' },
  operator: 'throws'
}
@abmusse
Copy link
Contributor Author

abmusse commented Jul 31, 2023

This failure seems to occur because the isAIX condition is being triggered here:

assert.throws(
() => { require('../fixtures/packages/is-dir'); },
common.isAIX ? { code: 'ERR_INVALID_PACKAGE_CONFIG' } : {
code: 'MODULE_NOT_FOUND',
message: /Cannot find module '\.\.\/fixtures\/packages\/is-dir'/
}
);

For reference the isAIX check runs:

const isAIX = process.platform === 'aix';

The root cause of the failure issue is that we are returning aix for process.platform when we are really IBM i.

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  Comparison {
+   code: 'MODULE_NOT_FOUND'
-   code: 'ERR_INVALID_PACKAGE_CONFIG'
  }

On IBM i we are returning MODULE_NOT_FOUND the same as the else leg of the above condition.

Our build system needs to be updated to use Python 3.9 which we switched sys.platform to return os400 (IBM i).

We already have a PR open for the upgrade #48056 (comment).

This is waiting on v8 change though!

See: #48056 (comment)

Once that PR gets merged we won't trigger the isAIX check and should pass as MODULE_NOT_FOUND would be returned.

@atlowChemi atlowChemi added test Issues and PRs related to the tests. ibm i Issues and PRs related to the IBM i platform. labels Jul 31, 2023
@abmusse
Copy link
Contributor Author

abmusse commented Aug 1, 2023

CC @nodejs/platform-ibmi

@richardlau
Copy link
Member

richardlau commented Oct 5, 2023

This test is now passing on IBM i after #48056.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ibm i Issues and PRs related to the IBM i platform. test Issues and PRs related to the tests.
Projects
None yet
Development

No branches or pull requests

3 participants