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 upgrade] Fix failing integration tests #991

Closed
Tracked by #920
boktorbb opened this issue Dec 1, 2021 · 1 comment
Closed
Tracked by #920

[Node.js upgrade] Fix failing integration tests #991

boktorbb opened this issue Dec 1, 2021 · 1 comment
Assignees

Comments

@boktorbb
Copy link
Contributor

boktorbb commented Dec 1, 2021

Integration Tests

On the first run the integration tests are failing with the following error:

(node:299336) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
Node.js process-warning detected:

DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    at new Object.<anonymous>.module.exports.internals.Response (/home/ubuntu/ws/OpenSearch-Dashboards/node_modules/shot/lib/response.js:22:23)
    at /home/ubuntu/ws/OpenSearch-Dashboards/node_modules/shot/lib/index.js:62:21
    at new Promise (<anonymous>)
    at Object.<anonymous>.exports.inject (/home/ubuntu/ws/OpenSearch-Dashboards/node_modules/shot/lib/index.js:59:12)
    at Object.<anonymous>.internals.Server.inject (/home/ubuntu/ws/OpenSearch-Dashboards/node_modules/hapi/lib/server.js:295:32)
    at OsdServer.inject (/home/ubuntu/ws/OpenSearch-Dashboards/src/legacy/server/osd_server.js:169:30)
    at Object.<anonymous> (/home/ubuntu/ws/OpenSearch-Dashboards/src/core/server/ui_settings/integration_tests/doc_missing.ts:41:21)
    at Object.asyncJestLifecycle (/home/ubuntu/ws/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:58:37)
    at /home/ubuntu/ws/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/queueRunner.js:45:12
    at new Promise (<anonymous>)
    at mapper (/home/ubuntu/ws/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
    at /home/ubuntu/ws/OpenSearch-Dashboards/node_modules/jest-jasmine2/build/queueRunner.js:75:41
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Terminating process...

 RUNS  src/core/server/ui_settings/integration_tests/index.test.ts
error Command failed with exit code 1.

This seems to be caused by the shot dependency, and addressing that requires upgrading hapi. This will come after the Node.js upgrade is complete.

After adding the --no-deprecation flag to the integration test script there are only 3 failing tests:

$ yarn test:jest_integration
yarn run v1.22.17
$ node scripts/jest_integration
...
Summary of all failing tests
 FAIL  src/core/server/metrics/integration_tests/server_collector.test.ts
  ● ServerMetricsCollector › collect requests infos

    expect(received).toEqual(expected) // deep equality

    - Expected  - 2
    + Received  + 1

      Object {
    -   "disconnects": 0,
    +   "disconnects": 1,
        "statusCodes": Object {
          "200": 2,
    -     "404": 1,
        },
        "total": 3,
      }

      84 |     metrics = await collector.collect();
      85 | 
    > 86 |     expect(metrics.requests).toEqual({
         |                              ^
      87 |       total: 3,
      88 |       disconnects: 0,
      89 |       statusCodes: {

      at Object.<anonymous> (src/core/server/metrics/integration_tests/server_collector.test.ts:86:30)

  ● ServerMetricsCollector › collect connection count

    expect(received).toEqual(expected) // deep equality

    Expected: 0
    Received: 1

      216 |     await Promise.all([res1, res2]);
      217 |     metrics = await collector.collect();
    > 218 |     expect(metrics.concurrent_connections).toEqual(0);
          |                                            ^
      219 |   });
      220 | 
      221 |   describe('#reset', () => {

      at Object.<anonymous> (src/core/server/metrics/integration_tests/server_collector.test.ts:218:44)

  ● ServerMetricsCollector › #reset › reset the requests state

    expect(received).toEqual(expected) // deep equality

    - Expected  - 2
    + Received  + 1

      Object {
    -   "disconnects": 0,
    +   "disconnects": 1,
        "statusCodes": Object {
          "200": 2,
    -     "404": 1,
        },
        "total": 3,
      }

      232 |       let metrics = await collector.collect();
      233 | 
    > 234 |       expect(metrics.requests).toEqual({
          |                                ^
      235 |         total: 3,
      236 |         disconnects: 0,
      237 |         statusCodes: {

      at Object.<anonymous> (src/core/server/metrics/integration_tests/server_collector.test.ts:234:32)


Test Suites: 1 failed, 49 passed, 50 total
Tests:       3 failed, 4 skipped, 430 passed, 437 total
Snapshots:   73 passed, 73 total
Time:        318.603 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@tmarkley
Copy link
Contributor

Fixed in #1027 and included in #1028

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
…rch-project#991)

* feat: add more metadata for event handlers
* chore: api update and addition of property documentation
* chore: added model key
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

Successfully merging a pull request may close this issue.

2 participants