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

Multiple persistent child-process-related test failures on Windows when running as a Service #19

Closed
rvagg opened this issue Nov 30, 2014 · 4 comments

Comments

@rvagg
Copy link
Member

rvagg commented Nov 30, 2014

This sucks because I want to run the Jenkins client as a service but when I do I get 4 persistent failures:

=== release test-child-process-double-pipe ===
Path: simple/test-child-process-double-pipe
grep stdin write 18
echo exit
grep stdin write 7
Command: c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\Release\node.exe c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\test\simple\test-child-process-double-pipe.js
--- TIMEOUT ---
=== release test-child-process-exit-code ===
Path: simple/test-child-process-exit-code
Command: c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\Release\node.exe c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\test\simple\test-child-process-exit-code.js
--- TIMEOUT ---
=== release test-child-process-spawnsync ===
Path: simple/test-child-process-spawnsync
sleep started
sleep exited [ 50, 509779200 ]
assert.js:100
  throw new assert.AssertionError({
        ^
AssertionError: sleep should not take longer or less than 1 second
    at Object.<anonymous> (c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\test\simple\test-child-process-spawnsync.js:44:8)
    at Module._compile (module.js:462:26)
    at Object.Module._extensions..js (module.js:480:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:503:10)
    at startup (node.js:135:16)
    at node.js:866:3
Command: c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\Release\node.exe c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\test\simple\test-child-process-spawnsync.js
=== release test-child-process-spawnsync-input ===
Path: simple/test-child-process-spawnsync-input
Command: c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\Release\node.exe c:\workspace\iojs+v0.12+multi\nodes\node-forward-rackspace-iad-win2012r2-msvs2013\test\simple\test-child-process-spawnsync-input.js
--- TIMEOUT ---

Compare Jenkins running as a service to running manually from cmd.

I'm using nssm with fairly standard options, running Jenkins from a 1-line .bat file and redirecting stdout and stderr to files.

Anybody have any clues about this? The only service-related problems I'm aware of are obvious ones like permissions problems. The test-child-process-spawnsync failure is particularly interesting. The sleep 1 appears to be taking 50 seconds (look at builds 47 and 48 and you'll see the same number!)--what's the significance of 50 seconds? A longer-than-expected execution might explain all of these errors but it's still not acceptable since running Node from a service on Windows is fairly common for production deployments.

@ralphtheninja
Copy link
Contributor

Since I don't have a clue about this I'm just gonna be the rubber duck instead.

So the only difference here is how you launch Jenkins? Have you tried experimenting changing which user is running the service?

One difference I see is which hudson .bat file is being run:

Build 49

[node-forward-rackspace-iad-win2012r2-msvs2013] $ cmd /c call C:\Windows\TEMP\hudson8301516808398704284.bat

Build 50

[node-forward-rackspace-iad-win2012r2-msvs2013] $ cmd /c call C:\Users\ADMINI~1\AppData\Local\Temp\2\hudson2421968505119472450.bat

@rvagg
Copy link
Member Author

rvagg commented Nov 30, 2014

@ralphtheninja I did consider permissions as a possible cause here but dismissed it because "why would a permissions problem manifest only in a few child process cases like sleep 1 taking 50 seconds?".

Shame on me for thinking that way, this is Windows after all! A bit of googling yielded this:

I had this same exact problem executing a .bat file which in turn made a call to git.cmd using Process.Start from a windows service. The git command would execute immediately if the .bat file was ran directly from the command line, but would delay exactly 50 seconds any time it was called from the windows service.

Again:

So, here's Jenkins being run explicitly as Administrator: https://jenkins-node-forward.nodesource.com/job/iojs+v0.12+multi/nodes=node-forward-rackspace-iad-win2012r2-msvs2013/lastBuild/console

And, also the first proper SUCCESS! #18 is still going to cause some problems but this is real progress!

@ralphtheninja
Copy link
Contributor

🍻

@rvagg rvagg closed this as completed Nov 30, 2014
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jun 27, 2020

CI: https://ci.nodejs.org/job/node-test-pull-request/32117/

(edit by @mmarchini: was testing something on nodejs/node-auto-test, but it seems like the bot always comments on this repository when a Jenkins PR Job starts. Sorry for the noise)

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

No branches or pull requests

3 participants