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

Node.js v18 Compatibility Test for [anomaly-detection-dashboards-plugin] #485

Closed
Tracked by #4058
ananzh opened this issue May 17, 2023 · 8 comments
Closed
Tracked by #4058
Assignees

Comments

@ananzh
Copy link
Member

ananzh commented May 17, 2023

Introduction

As part of our continued efforts to improve OpenSearch Dashboards, we are planning to upgrade the underlying Node.js version from v14 to v18. This change will enhance performance, add new features, and bolster security. However, such major version changes might also affect the compatibility of existing plugins. Here is more introduction: opensearch-project/OpenSearch-Dashboards#3601.

Therefore, we kindly request assistance in testing this plugin the compatibility of with this new version of Node.js. We've raised a PR with the Node.js v18 upgrade, which you can find here:
opensearch-project/OpenSearch-Dashboards#4071

Steps to Proceed

  • If you think your plugin won't be affected by OpenSearch Dashboards Node.js upgrade. Pls ignore the rest steps and close the issue directly.
  • Pull the provided branch that includes the Node.js v18 upgrade and OpenSearch 3.0.0.
  • Hook up your plugin with the updated OpenSearch Dashboards.
  • Run your existing test suites and perform manual testing as necessary.
  • If no issues are encountered, feel free to close this issue.
  • If there are any problems, report them in this issue thread and also link them in the overall OpenSearch Dashboards Node.js upgrade issue thread Upcoming Transition to Node.js v18: Plugin Compatibility Test Required Overall Issue OpenSearch-Dashboards#4058
    The purpose of linking any questions or issues back to the main issue is to maintain visibility and transparency among all plugin owners. A problem encountered by one plugin might also affect others. This shared knowledge base will foster collaborative problem-solving and prevent duplication of effort.

We appreciate your support and cooperation in ensuring a smooth transition to Node.js v18 for the entire OpenSearch Dashboards community.

@ananzh
Copy link
Member Author

ananzh commented May 22, 2023

The official Node.js 18 PR raised in OSD: opensearch-project/OpenSearch-Dashboards#4071

@kaituo kaituo removed the untriaged label May 22, 2023
@kaituo
Copy link
Collaborator

kaituo commented May 22, 2023

will look for an owner for this

@amitgalitz amitgalitz self-assigned this May 22, 2023
@amitgalitz
Copy link
Member

@ananzh just to confirm this should be labeled 2.8 and completed for that release?

@ananzh
Copy link
Member Author

ananzh commented May 22, 2023

@amitgalitz yes. opensearch-project/OpenSearch-Dashboards#4071 will be first merged into OSD main then backport to 2.x. We will use 2.x to cut 2.8. Therefore, we hope it has been tested well by all plugins.

opensearch-project/OpenSearch-Dashboards#4071 support node 14, 16 and 18. Pls test on node 18.

nvm install 18.16.0
nvm use 18.16.0

@amitgalitz
Copy link
Member

Node 18 isn't compatible on Centos7 or macos. Will have to spin up and test this on ubuntu but anyway I assume this means that there should be a fallback to node 14 as this is a minor release

@ananzh
Copy link
Member Author

ananzh commented May 23, 2023

@amitgalitz MacOS should work, I commented on ur error opensearch-project/OpenSearch-Dashboards#4058 (comment)

@amitgalitz
Copy link
Member

All integration test pass but we have one failing unit tests I am looking into:

Node.js v18.16.0
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Required".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v18.16.0
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Required".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v18.16.0
 FAIL  public/pages/DefineDetector/components/NameAndDescription/__tests__/NameAndDescription.test.tsx
  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (../../node_modules/jest-worker/build/workers/ChildProcessWorker.js:185:21)

Summary of all failing tests
 FAIL  public/pages/DefineDetector/components/NameAndDescription/__tests__/NameAndDescription.test.tsx
  ● Test suite failed to run

    Jest worker encountered 4 child process exceptions, exceeding retry limit

      at ChildProcessWorker.initialize (../../node_modules/jest-worker/build/workers/ChildProcessWorker.js:185:21)
      ```

@ananzh
Copy link
Member Author

ananzh commented May 24, 2023

@amitgalitz This error message is coming from Node.js, and it is telling you that there’s a promise in your code which is being rejected without having a .catch() block to handle the rejection. If you don’t provide a .catch() method or the second argument to .then()), Node.js emits an unhandledRejection event. As of Node.js version 15.x and above, the default behavior is to terminate the process when such an event occurs. So you need to find out which test fail and cause this. Then track back to which function has unhandled promise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants