-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Conversation
@othiym23 Thank you! I'll take a look as soon as possible. |
Running npm's tests suite with current node v0.12 makes a lot of tests time out. Running the same tests suite with node v0.10.36 works fine. It seems that the problem is that the
|
The breaking change seems to be npm/npm@c2cccd4, and more specifically the use of I'm a bit puzzled by the commit message that states:
because this change actually seems to break node v0.11.x and io.js 1.0.1. @othiym23 Could you please provide me with more context on why this change was needed? |
See npm/npm-registry-client@4701a29 for @fengmk2's commit. Maybe he can provide you with more detail? I'm still confused as to why you are seeing these test failures but I'm not. Have you rebased my change into a later base? |
@othiym23 It seems that the Also, when testing, I rebased this PR on top of the current tip of v0.12. |
How do you figure? The 'Makefile' is using the freshly-built node to run the tests. I will rebase against |
And test-all uses |
Or, rather, I thought it did. I applied this patch to the Makefile: diff --git a/Makefile b/Makefile
index 6c148eb..9f388c4 100644
--- a/Makefile
+++ b/Makefile
@@ -154,12 +154,15 @@ test-npm: node
cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \
npm_config_prefix="$(shell pwd)/npm-prefix" \
npm_config_tmp="$(shell pwd)/npm-tmp" \
- ../../node cli.js install
+ PATH="../..:/bin:/usr/bin" \
+ node cli.js install
cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \
npm_config_prefix="$(shell pwd)/npm-prefix" \
npm_config_tmp="$(shell pwd)/npm-tmp" \
- ../../node cli.js run-script test-all && \
- ../../node cli.js prune --prod && \
+ PATH="../..:/bin:/usr/bin" \
+ node cli.js run-script test-all && \
+ PATH="../..:/bin:/usr/bin" \
+ node cli.js prune --prod && \
cd ../.. && \
rm -rf npm-cache npm-tmp npm-prefix ...and now I am seeing some failures as well. I'm reluctant to back out @fengmk2's changes without a better understanding of what the changes were meant to accomplish -- replacing the agent hasn't caused any problems (that I know of) in iojs or Node 0.10, so there's something happening at a lower level that I don't understand. |
The problem can be reproduced outside of npm tests. I'll investigate further and I'll keep you posted. Thank you! |
Thanks to @tjfontaine, we've been able to find out the issue with the tests timing out. Basically, when tests "npm install" a package, the npm-registry-client uses a HTTP agent that with keepAlive enabled. On both sides, the connection is not closed by default when the HTTP request is finished because the client explicitly asked for the connection to be kept alive. On the client side, the tcp connection handle is unref'd and thus doesn't hold the loop active. However, on the server side, the tcp handle is not unref'd and thus holds the loop active, and eventually makes node hangs, which in turn makes tests time out. It can be verified for instance by unref'ing the connection on the server's side. This is expected behavior that is not intuitive when both the client and the server are in the same process. Indeed, most of the time, the client and the server are not the same process and the code that hangs works as expected intuitively. If this test had the client and the server in separate processes, when the client tcp handle is unref'd, the client process would exit and this would close the connection, unref'ing the tcp handle in the server process, which would then also exit properly. The tests will need to be fixed in npm, but in the meantime this PR is LGTM, as binary packages have been tested on OS X and Windows without any issue, and the only tests failing fail by timing out due to this keepAlive issue, but the actual tests pass. |
I concur -- LGTM |
PR: nodejs#9086 PR-URL: nodejs#9086 Reviewed-By: Julien Gilli <julien.gilli@joyent.com> Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Also created #9107 to avoid running npm's tests with a different version of node than intended when running 'make test-npm'. |
* build: Fix building with shared zlib. (Bradley T. Hughes) [nodejs#9077](nodejs/node#9077) * stream: fix `Writable` subclass instanceof checks (Anna Henningsen) [nodejs#9088](nodejs/node#9088) * timers: fix regression with clearImmediate() (Brian White) [nodejs#9086](nodejs/node#9086) PR-URL: nodejs/node#9104
* build: Fix building with shared zlib. (Bradley T. Hughes) [nodejs#9077](nodejs/node#9077) * stream: fix `Writable` subclass instanceof checks (Anna Henningsen) [nodejs#9088](nodejs/node#9088) * timers: fix regression with clearImmediate() (Brian White) [nodejs#9086](nodejs/node#9086) PR-URL: nodejs/node#9104
As discussed on #9078, here is
npm@2.3.0
.make test-npm
ran without issue on OS X Yosemite.r=@misterdjules