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: fix embedding test for Windows #53659

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

vmoroz
Copy link
Member

@vmoroz vmoroz commented Jun 30, 2024

PR #52905 had added a new test case for embedding test which was failing for Windows.
The reason was that the expected error message has the Posix-specific line ending \n while on Windows the output string contains \r\n:

stderr: `${binary}: NODE_REPL_EXTERNAL_MODULE can't be used with kDisableNodeOptionsEnv\n`,

PR #52905 temporary disabled this new test case for Windows.

This PR removes the temporary test disablement for Windows and implements the fix by replacing \n in the test with os.EOL. After this change the embedding test is passing for Windows.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jun 30, 2024
@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 30, 2024
@vmoroz vmoroz added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jun 30, 2024
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

LGTM although I think it's fine to simply use a looser regexp in test-embedding.js and just match

stderr: /NODE_REPL_EXTERNAL_MODULE can't be used with kDisableNodeOptionsEnv/

@vmoroz
Copy link
Member Author

vmoroz commented Jul 1, 2024

LGTM although I think it's fine to simply use a looser regexp in test-embedding.js and just match

stderr: /NODE_REPL_EXTERNAL_MODULE can't be used with kDisableNodeOptionsEnv/

Thanks! I had considered it initially, but decided on the str.replaceAll solution mostly to avoid similar issues in future. Developers who do not have access to Windows machines can use the \n in any other tests and not to be blocked anymore.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2024
@nodejs-github-bot
Copy link
Collaborator

@vmoroz vmoroz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@nodejs-github-bot
Copy link
Collaborator

@vmoroz vmoroz force-pushed the PR/fix_embdedtest_on_windows branch from 8632afa to e747896 Compare July 12, 2024 15:05
@vmoroz vmoroz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Jul 21, 2024

Consistent failure on Windows:

---
duration_ms: 599.985
exitcode: 1
severity: fail
stack: |-
  Testing with --turbo-fast-api-calls: freopen
  [process 7672]: --- stderr ---
  (node:7672) ExperimentalWarning: WASI is an experimental feature and might change at any time
  (Use `node --trace-warnings ...` to show where the warning was created)
  fd_prestat_get(3, 70936)
  fd_prestat_dir_name(3, 70960, 8)
  fd_prestat_get(4, 70936)
  fd_prestat_dir_name(4, 70960, 4)
  fd_prestat_get(5, 70936)
  fd_fdstat_get(3, 70872)
  path_open(3, 1, 1062, 9, 0, 264240830, 268435455, 0, 70868)
  fd_fdstat_get(3, 70856)
  path_open(3, 1, 1081, 10, 0, 264240830, 268435455, 0, 70852)
  fd_renumber(6, 5)
  fd_close(4294967295)
  fd_read(5, 70872, 1, 70868)
  fd_fdstat_get(1, 70872)
  fd_write(1, 70880, 2, 70876)
  fd_read(5, 70872, 1, 70868)

  [process 7672]: --- stdout ---
  hello from input2.txt

  [process 7672]: status = 0, signal = null
  C:\workspace\node-test-binary-windows-js-suites\node\test\common\child_process.js:90
      throw new Error(`${failures.join('\n')}`);
      ^

  Error: - stdout did not match 'hello from input2.txt\r\n'
      at logAndThrow (C:\workspace\node-test-binary-windows-js-suites\node\test\common\child_process.js:90:11)
      at expectSyncExit (C:\workspace\node-test-binary-windows-js-suites\node\test\common\child_process.js:113:5)
      at spawnSyncAndAssert (C:\workspace\node-test-binary-windows-js-suites\node\test\common\child_process.js:135:10)
      at testWasiPreview1 (C:\workspace\node-test-binary-windows-js-suites\node\test\common\wasi.js:18:3)
      at Object.<anonymous> (C:\workspace\node-test-binary-windows-js-suites\node\test\wasi\test-wasi-io.js:6:1)
      at Module._compile (node:internal/modules/cjs/loader:1505:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1589:10)
      at Module.load (node:internal/modules/cjs/loader:1283:32)
      at Module._load (node:internal/modules/cjs/loader:1099:12)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)

  Node.js v23.0.0-pre
...

@aduh95 aduh95 removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 21, 2024
@vmoroz
Copy link
Member Author

vmoroz commented Jul 22, 2024

@aduh95 , yes, the CI failure is caused by this PR. The PR normalizes the output to use only the \n line ends while one of the tests does the comparison adjusted for the platform. I am going to fix this issue soon.

@vmoroz vmoroz force-pushed the PR/fix_embdedtest_on_windows branch from e747896 to 475e870 Compare August 10, 2024 21:08
Copy link

codecov bot commented Aug 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.09%. Comparing base (37f9eca) to head (d8314e9).
Report is 165 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #53659   +/-   ##
=======================================
  Coverage   87.09%   87.09%           
=======================================
  Files         647      647           
  Lines      181817   181843   +26     
  Branches    34883    34887    +4     
=======================================
+ Hits       158348   158382   +34     
+ Misses      16764    16763    -1     
+ Partials     6705     6698    -7     

see 29 files with indirect coverage changes

@vmoroz vmoroz added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@vmoroz vmoroz added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 18, 2024
@vmoroz
Copy link
Member Author

vmoroz commented Aug 18, 2024

None of the failures seems to be related to this PR.
I wonder if we have any PR that can cleanly pass all the CI checks in the last few weeks.
They either fail because of flaky tests or CI machine runs out of disk space (on Macs).
@mhdawson , @legendecas , could you help with merging this PR?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@legendecas
Copy link
Member

@vmoroz I noticed that you may pushed "rebuild" button on jenkins. An alternative to "rebuild" is "resume" which does not re-run successful sub-tasks. This can greatly help with the churn of flakiness that are unrelated to this PR.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@legendecas legendecas added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Aug 27, 2024
@vmoroz vmoroz added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 27, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 27, 2024
@nodejs-github-bot nodejs-github-bot merged commit 0b3ae01 into nodejs:main Aug 27, 2024
61 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 0b3ae01

RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
PR-URL: #53659
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
PR-URL: #53659
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stefan Stojanovic <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants