Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Run Test on Node v12 Failed #756

Closed
junminstorage opened this issue Apr 13, 2021 · 6 comments · Fixed by #762
Closed

Run Test on Node v12 Failed #756

junminstorage opened this issue Apr 13, 2021 · 6 comments · Fixed by #762

Comments

@junminstorage
Copy link
Contributor

There are multiple opened PRs are failing due to the following errors:

  1. GraphQL-HTTP tests for restify
    Custom result extensions
    does nothing if extensions function does not return an object:
    DeprecationWarning: The legacy HTTP parser is deprecated.
    at
    at internalBinding (internal/bootstrap/loaders.js:136:34)
    at process.binding (internal/bootstrap/loaders.js:113:14)
    at Object. (node_modules/http-deceiver/lib/deceiver.js:22:24)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (node_modules/spdy/lib/spdy/handle.js:5:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (node_modules/spdy/lib/spdy.js:6:15)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (node_modules/restify/lib/server.js:14:12)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (node_modules/restify/lib/index.js:10:14)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at /home/runner/work/express-graphql/express-graphql/src/tests/http-test.ts:133:21
    at Context. (src/tests/http-test.ts:2338:19)
    at processImmediate (internal/timers.js:461:21)

npm ERR! code ELIFECYCLE
npm ERR! errno 83
npm ERR! express-graphql@0.12.0 testonly: mocha src/**/__tests__/**/*.ts
npm ERR! Exit status 83
npm ERR!
npm ERR! Failed at the express-graphql@0.12.0 testonly script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-04-13T02_03_31_597Z-debug.log
Error: Process completed with exit code 83.

@acao
Copy link
Member

acao commented Apr 13, 2021

Have no idea where the error is. The deprecation warning shouldn’t be throwing an exception? Unless it’s not actually a true deprecation?

@junminstorage
Copy link
Contributor Author

Right, the deprecate warning should not cause mocha test failed. maybe there are mocha test runner options for us to adjust to ignore this.
And we spawned child process to run Node v12 test, I wonder if we can something like childProcess.removeAllListeners('warning')

@junminstorage
Copy link
Contributor Author

Also the https://github.com/restify/node-restify#supported-node-versions doesn't specifically mention about supporting Node v12.

@acao
Copy link
Member

acao commented Apr 13, 2021

You’re right this it it:

nodejs/undici#702

maybe we can just pin the version of the node-restify lib for now to one that works with node 12? Or upgrade it?

@justinmchase
Copy link

I found this:
https://github.com/creationix/http-parser-js#readme

It looks like on that version of node the http parser is deprecated, newer versions its fixed. It looks like you can import this module and monkey patch the version and it will fix it for node:12

@junminstorage
Copy link
Contributor Author

@justinmchase thanks for that. I made various changes in the PR accordingly e.g. https://github.com/graphql/express-graphql/pull/755/files#diff-ca140513f036f6bfbb6a70f1aa37af734be5b256801097041211bd7fa7f15584R18
node12 tests still failed. Maybe I did something wrong?

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

Successfully merging a pull request may close this issue.

3 participants