You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 10.7.0 release is causing the Yarn test suite to fail (which prevents us from releasing the 1.9, but also might cause issues with everyone already using Yarn), something related to timeouts:
TypeError: sock.setTimeout is not a function
at setSocketTimeout (_http_client.js:739:10)
at ClientRequest.setTimeout (_http_client.js:725:5)
at setReqTimeout (/Users/mael/yarn/node_modules/request/request.js:817:16)
at ClientRequest.<anonymous> (/Users/mael/yarn/node_modules/request/request.js:860:9)
at ClientRequest.emit (events.js:187:15)
at tickOnSocket (_http_client.js:645:7)
at onSocketNT (_http_client.js:684:5)
at process._tickCallback (internal/process/next_tick.js:63:19)
A single commit has been pushed to this file between the 10.6.0 and the 10.7.0 and it happens to change the timeout behavior, which would be consistent with the reported error: 949e885 (cc @killagu).
The previous code was attaching on the connect event from the fake socket, which was never triggered and so the setTimeout was never called. Now that setTimeout is always called when the socket is there, the bug triggers.
I think this is on Yarn, so I'm going to close this issue. Feel free to reopen if you think it hides a more problematic regression.
@arcanis This is one of the reasons why trying to keep the reproducable testcases minimal matters.
I attempted to construct a testcase without yarn. To trace that, I noticed that the error was coming from the request module (as observed in the original trace), and tried to check how exactly are you using request. That was done by adding these two lines to it:
--- node_modules/request/request.js****************** 93,94 ****--- 93,96 ----
function Request (options) {
+ console.log('Request', JSON.stringify(options));+ console.log((new Error()).stack)
// if given the method property in options, set property explicitMethod to true
That brought me directly to the mock file (and gave the short testcase in the comment above).
Related: There's a PR to get yarn into citgm but it stalled. If someone wants to take it over and get it across the finish line, it would be great to have citgm flag these kinds of things for us before a release: nodejs/citgm#560
Reacted by Maël Nison, Sagir Khan, Nikita Skovoroda and killa
Activity
ChALkeR commentedon Jul 20, 2018
Thas commit comes from #21204.
/cc @Trott @nodejs/http
@arcanis a shorter testcase would be helpful.
ChALkeR commentedon Jul 20, 2018
@arcanis This does not look to be observed when run without the mock from https://github.com/yarnpkg/yarn/blob/master/__tests__/__mocks__/request.js.
ChALkeR commentedon Jul 20, 2018
A reproducable testcase without all the other
yarnstuff (but withrequest)This is basically what Yarn does.
arcanis commentedon Jul 20, 2018
You're right, seems like this is caused in particular by the mock of
createConnection:The previous code was attaching on the
connectevent from the fake socket, which was never triggered and so the setTimeout was never called. Now that setTimeout is always called when the socket is there, the bug triggers.I think this is on Yarn, so I'm going to close this issue. Feel free to reopen if you think it hides a more problematic regression.
arcanis commentedon Jul 20, 2018
And thanks for your help, greatly appreciated!
dougwilson commentedon Jul 20, 2018
If it's the mock, my guess is that it is due to
dougwilson commentedon Jul 20, 2018
Wow a lot of conversation happened while I was posted that :) disregard
ChALkeR commentedon Jul 20, 2018
@arcanis This is one of the reasons why trying to keep the reproducable testcases minimal matters.
I attempted to construct a testcase without yarn. To trace that, I noticed that the error was coming from the
requestmodule (as observed in the original trace), and tried to check how exactly are you usingrequest. That was done by adding these two lines to it:That brought me directly to the mock file (and gave the short testcase in the comment above).
Hope that helps 😉.
arcanis commentedon Jul 20, 2018
Yeah, I actually logged the options to try to make repros, but completely forgot we mocked request, so didn't check the stack 😐
Trott commentedon Jul 20, 2018
Related: There's a PR to get
yarnintocitgmbut it stalled. If someone wants to take it over and get it across the finish line, it would be great to havecitgmflag these kinds of things for us before a release: nodejs/citgm#560targos commentedon Jul 20, 2018
@ChALkeR little debugging tip: instead of the double
console.log, you can doconsole.trace('Request', JSON.stringify(options))