node.js tests always time out, but works fine locally

Steven Vachon's Avatar

Steven Vachon

15 May, 2015 10:55 PM

This is a mocha error:

Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
and this is from elsewhere:
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

Command executed with exception: npm ERR! Test failed. See above for more details.
  1. Support Staff 1 Posted by Feodor Fitsner on 15 May, 2015 11:15 PM

    Feodor Fitsner's Avatar

    What does that test do?

    - Feodor

  2. 2 Posted by Steven Vachon on 16 May, 2015 01:03 PM

    Steven Vachon's Avatar

    It runs a shell command:

    cscript /path/to/hostscript.js /working-path/ //nologo //E:jscript

    which runs this hostscript:

  3. Support Staff 3 Posted by Feodor Fitsner on 18 May, 2015 05:48 PM

    Feodor Fitsner's Avatar

    On Pro faster environment that test worked:

    Apparently, 2 seconds timeout is not enough on Azure instances to complete the call to cscript.

  4. 4 Posted by Steven Vachon on 19 May, 2015 01:00 PM

    Steven Vachon's Avatar

    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.

    Node v0.12 tests are failing with a new error:

  5. 5 Posted by Steven Vachon on 20 May, 2015 10:12 PM

    Steven Vachon's Avatar

    Any idea why that library failed to install in x86 but not x64? It appears to be consistent.

  6. Support Staff 6 Posted by Feodor Fitsner on 20 May, 2015 10:14 PM

    Feodor Fitsner's Avatar

    What's your appveyor.yml?

  7. 7 Posted by Steven Vachon on 20 May, 2015 10:18 PM

    Steven Vachon's Avatar
    # Test against these versions of Node.js.
        # 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
        - nodejs_version: "1.0"
        - nodejs_version: "2.0"
      - x86
      - x64
    # Install scripts. (runs after repo cloning)
      # 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.
      # 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}"
  8. Support Staff 8 Posted by Feodor Fitsner on 20 May, 2015 10:19 PM

    Feodor Fitsner's Avatar

    OK, platform does nothing with this setup.

    To switch node.js platform use:

    - ps: Install-Product node $env:nodejs_version $env:platform
  9. 9 Posted by Steven Vachon on 21 May, 2015 01:48 AM

    Steven Vachon's Avatar

    I'll try, but the build page communicates that it worked as I'd expected it to:

    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
  10. Support Staff 10 Posted by Feodor Fitsner on 21 May, 2015 03:49 AM

    Feodor Fitsner's Avatar

    platform was primarily introduced for MSBuild, but became popular in other applications later. platform doesn't mean you are selecting the bitness of underlying operating system - it's always Windows Server 2012 R2 x64. However, platform is assigned to environment variable and can be used in cmdlet switching node.js or other places.

  11. 11 Posted by Steven Vachon on 21 May, 2015 12:50 PM

    Steven Vachon's Avatar

    Very interesting. Thank you! It all appears to be running well now!

  12. Steven Vachon closed this discussion on 21 May, 2015 12:51 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac