tag:help.appveyor.com,2012-11-13:/discussions/problems/2160-nodejs-tests-always-time-out-but-works-fine-locallyAppVeyor: Discussion 2018-10-19T08:17:12Ztag:help.appveyor.com,2012-11-13:Comment/368484462015-05-15T22:55:19Z2015-05-15T22:56:09Znode.js tests always time out, but works fine locally<div><p>This is a mocha error:<br></p>
<pre>
<code>Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.</code>
</pre>
and this is from elsewhere:<br>
<pre>
<code>npm : npm ERR! Test failed. See above for more details.
At line:1 char:1
+ npm test # PowerShell
+ ~~~~~~~~
+ CategoryInfo : NotSpecified: (npm ERR! Test f...r more details.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError<br><br>
<br>Command executed with exception: npm ERR! Test failed. See above for more details.</code>
</pre>
<a href="https://ci.appveyor.com/project/stevenvachon/winattr">https://ci.appveyor.com/project/stevenvachon/winattr</a></div>Steven Vachontag:help.appveyor.com,2012-11-13:Comment/368484462015-05-15T23:15:29Z2015-05-15T23:15:29Znode.js tests always time out, but works fine locally<div><p>What does that test do?</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368484462015-05-16T13:03:46Z2015-05-16T13:05:15Znode.js tests always time out, but works fine locally<div><p>It runs a shell command:<br></p>
<pre>
<code>cscript /path/to/hostscript.js /working-path/ //nologo //E:jscript</code>
</pre>
<a href="https://github.com/stevenvachon/winattr/blob/master/lib/exec/index.js#L15-L23">https://github.com/stevenvachon/winattr/blob/master/lib/exec/index....</a>
<p>which runs this hostscript: <a href="https://github.com/stevenvachon/winattr/blob/master/lib/exec/hostscript.js">
https://github.com/stevenvachon/winattr/blob/master/lib/exec/hostsc...</a></p></div>Steven Vachontag:help.appveyor.com,2012-11-13:Comment/368484462015-05-18T17:48:16Z2015-05-18T17:48:16Znode.js tests always time out, but works fine locally<div><p>On Pro faster environment that test worked: <a href="https://ci.appveyor.com/project/FeodorFitsner/winattr">https://ci.appveyor.com/project/FeodorFitsner/winattr</a></p>
<p>Apparently, 2 seconds timeout is not enough on Azure instances
to complete the call to cscript.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368484462015-05-19T13:00:14Z2015-05-19T13:01:05Znode.js tests always time out, but works fine locally<div><p>The node v0.10 tests are passing now that the timeout has been
increased to 5 seconds, but I don't understand why that made a
difference because the test runner (mocha) reports that the tests
only took 100–150ms to complete.</p>
<p>Node v0.12 tests are failing with a new error: <a href="https://ci.appveyor.com/project/stevenvachon/winattr/build/job/agdlbsnln7ldclmc">
https://ci.appveyor.com/project/stevenvachon/winattr/build/job/agdl...</a></p></div>Steven Vachontag:help.appveyor.com,2012-11-13:Comment/368484462015-05-20T22:12:55Z2015-05-20T22:13:08Znode.js tests always time out, but works fine locally<div><p>Any idea why that library failed to install in x86 but not x64?
It appears to be consistent.</p></div>Steven Vachontag:help.appveyor.com,2012-11-13:Comment/368484462015-05-20T22:14:04Z2015-05-20T22:14:04Znode.js tests always time out, but works fine locally<div><p>What's your appveyor.yml?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368484462015-05-20T22:18:06Z2015-05-20T22:18:06Znode.js tests always time out, but works fine locally<div><pre>
<code># Test against these versions of Node.js.
environment:
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
# io.js
- nodejs_version: "1.0"
- nodejs_version: "2.0"
# fswin currently does not support io.js
matrix:
allow_failures:
- nodejs_version: "1.0"
- nodejs_version: "2.0"
platform:
- x86
- x64
# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install
# Post-install test scripts.
test_script:
# Output useful info for debugging.
- node --version
- npm --version
# run tests
- ps: "npm test # PowerShell" # Pass comment to PS for easier debugging
- cmd: npm test
# Don't actually build.
build: off
# Set build version format here instead of in the admin panel.
version: "{build}"</code>
</pre></div>Steven Vachontag:help.appveyor.com,2012-11-13:Comment/368484462015-05-20T22:19:55Z2015-05-20T22:19:55Znode.js tests always time out, but works fine locally<div><p>OK, <code>platform</code> does nothing with this setup.</p>
<p>To switch node.js platform use:</p>
<pre>
<code>- ps: Install-Product node $env:nodejs_version $env:platform</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368484462015-05-21T01:48:01Z2015-05-21T01:55:14Znode.js tests always time out, but works fine locally<div><p>I'll try, but the build page communicates that it worked as I'd
expected it to:<br></p>
<pre>
<code>Environment: nodejs_version=0.10; Platform: x86 1 min 41 sec
Environment: nodejs_version=0.10; Platform: x64 1 min 28 sec
Environment: nodejs_version=0.12; Platform: x86 1 min 12 sec
Environment: nodejs_version=0.12; Platform: x64 1 min 39 sec
Environment: nodejs_version=1.0; Platform: x86 1 min 55 sec
Environment: nodejs_version=1.0; Platform: x64 1 min 13 sec
Environment: nodejs_version=2.0; Platform: x86 1 min 35 sec
Environment: nodejs_version=2.0; Platform: x64 1 min 5 sec</code>
</pre></div>Steven Vachontag:help.appveyor.com,2012-11-13:Comment/368484462015-05-21T03:49:27Z2015-05-21T03:49:27Znode.js tests always time out, but works fine locally<div><p><code>platform</code> was primarily introduced for MSBuild, but
became popular in other applications later. <code>platform</code>
doesn't mean you are selecting the bitness of underlying operating
system - it's always Windows Server 2012 R2 x64. However,
<code>platform</code> is assigned to environment variable and can
be used in cmdlet switching node.js or other places.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/368484462015-05-21T12:50:54Z2015-05-21T12:50:54Znode.js tests always time out, but works fine locally<div><p>Very interesting. Thank you! It all appears to be running well
now!</p></div>Steven Vachon