Skip to content

Fix CI on Node 7.7.2 - #3262

Merged
bajtos merged 1 commit into
masterfrom
fix/ci-on-node-7.7.2
Mar 9, 2017
Merged

Fix CI on Node 7.7.2#3262
bajtos merged 1 commit into
masterfrom
fix/ci-on-node-7.7.2

Conversation

@bajtos

@bajtosbajtos commented Mar 9, 2017

Copy link
Copy Markdown
Member

Description

Add workaround for what seems to be a Node 7.7.2 regression: net.createConnection(port) is failing with the following error, see e.g. https://travis-ci.org/strongloop/loopback/jobs/209262349:

 1) loopback application pauses request stream during authentication:
Uncaught TypeError: "listener" argument must be a function
at Socket.connect (net.js:943:10)
at Socket.connect (node_modules/async-listener/index.js:76:27)
at Object.exports.connect.exports.createConnection (net.js:76:35)
at sendHttpRequestInOnePacket (test/integration.test.js:77:24)
at Server.<anonymous> (test/integration.test.js:19:7)
at emitListeningNT (net.js:1302:10)
at node_modules/async-listener/glue.js:188:31
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:128:9)

The same code passes on Node 7.7.1, see e.g. https://travis-ci.org/strongloop/loopback/jobs/209009746.

My proposed workaround is to explicitly pass a no-op callback argument:

net.createConnection(port,()=>{});

Strangely enough, the problem CANNOT be reproduced when the failing test is run in isolation via mocha test/integration.test.js. To reproduce it, one has to add few more tests making HTTP requests, e.g. via

$ mocha -R dot test/access-control.integration.js test/integration.test.js

From looking at recent Node.js changes, it seems the problem was introduced by nodejs/node@b56e851 from nodejs/node#11667.

@joyeecheung@mcollina@jasnell you have authored/reviewed that patch, do you happen to have any insights on what may be wrong here?

cc @sam-github

@bajtosbajtos changed the title Fix CI on Node 7.7.2Add workaround for Node 7.7.2 regressionFix CI on Node 7.7.2Mar 9, 2017
@bajtos
bajtos requested a review from superkhauMarch 9, 2017 09:29
@joyeecheung

joyeecheung commented Mar 9, 2017

Copy link
Copy Markdown

It is indeed a regression from Node's side. Should be fixed by nodejs/node#11762

@bajtos

Copy link
Copy Markdown
MemberAuthor

@joyeecheung lovely, thank you for chiming in and pointing us to the pull request fixing the regression. 👍 ❤️

In this light, I will rework my pull request to simply lock Travis CI config to 7.7.1 until a fixed version of Node.js is available.

@bajtos
bajtosforce-pushed the fix/ci-on-node-7.7.2 branch from 4ba2a8e to 6467658CompareMarch 9, 2017 12:17
@bajtos
bajtos merged commit 3a93167 into masterMar 9, 2017
@bajtos
bajtos deleted the fix/ci-on-node-7.7.2 branch March 9, 2017 12:32
@bajtosbajtos removed the review label Mar 9, 2017
@superkhau

Copy link
Copy Markdown
Contributor

LGTM

@italoacasas

Copy link
Copy Markdown

@bajtos

Copy link
Copy Markdown
MemberAuthor

@italoacasas thanks! I opened a pull request to revert our Travis CI config back - #3285

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@bajtos@joyeecheung@superkhau@italoacasas