Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

protractor hangs indefinitely on "[launcher] Running 1 instances of WebDriver" - when running with xvfb #2419

Open
@borisdiakur

Description

@borisdiakur

At first glance this issue seems to be related with #1764 but I don't see how a network issue can cause the hanging here (directConnect is set to true). So here is the setup:

protractor-config.js

'use strict';

/* globals jasmine, browser */
exports.config = {
    allScriptsTimeout: 300000, // 5 min

    // Spec patterns are relative to this directory.
    specs: [
        'protractor/*.js'
    ],

    capabilities: {
        'browserName': 'chrome',
        version: '',
        platform: 'ANY'
    },

    directConnect: true,

    baseUrl: 'http://localhost:3000/', // gets overwritten

    troubleshoot: true,

    framework: 'jasmine',
    onPrepare: function beforeProtractorRuns() {
        browser.driver.manage().window().setSize(1280, 1024);

        // Disable animations so e2e tests run more quickly
        var disableNgAnimate = function () {
            angular.module('disableNgAnimate', []).run([
                '$animate',
                function ($animate) {
                    $animate.enabled(false);
                }
            ]);
        };
        browser.addMockModule('disableNgAnimate', disableNgAnimate);

        // see: https://github.com/angular/protractor/issues/60
        require('jasmine-reporters');
        var capsPromise = browser.getCapabilities();
        capsPromise.then(function setOutputDir(caps) {
            var browserName = caps.caps_.browserName.toUpperCase();
            var browserVersion = caps.caps_.version;
            var filePrefix = browserName + '-' + browserVersion + '-';
            jasmine.getEnv().addReporter(
                new jasmine.JUnitXmlReporter(
                    'build/reports/testresults',
                    true, //consolidate: save nested describes within the same file as their parent
                    true, //useDotNotation: separate suite names with dots rather than spaces (ie "Class.init" not "Class init")
                    filePrefix
                )
            );
        });
    },

    jasmineNodeOpts: {
        isVerbose: true,
        showColors: true,
        includeStackTrace: true,
        defaultTimeoutInterval: 300000, // 5 min
    }
};

Here is an extract of the essential parts of the Jenkins Job console log:

⋮
13:28:22 DEBUG - Running with --troubleshoot
13:28:22 DEBUG - Protractor version: 2.1.0
13:28:22 DEBUG - Your base url for tests is http://localhost:57505/
13:28:22 Using ChromeDriver directly...
13:28:22 [launcher] Running 1 instances of WebDriver
13:28:22 DEBUG - WebDriver session successfully started with capabilities { caps_: 
13:28:22    { acceptSslCerts: true,
13:28:22      applicationCacheEnabled: false,
13:28:22      browserConnectionEnabled: false,
13:28:22      browserName: 'chrome',
13:28:22      chrome: { userDataDir: '/tmp/.com.google.Chrome.AuA2qr' },
13:28:22      cssSelectorsEnabled: true,
13:28:22      databaseEnabled: false,
13:28:22      handlesAlerts: true,
13:28:22      javascriptEnabled: true,
13:28:22      locationContextEnabled: true,
13:28:22      mobileEmulationEnabled: false,
13:28:22      nativeEvents: true,
13:28:22      platform: 'Linux',
13:28:22      rotatable: false,
13:28:22      takesHeapSnapshot: true,
13:28:22      takesScreenshot: true,
13:28:22      version: '44.0.2403.125',
13:28:22      webStorageEnabled: true } }
13:28:30 Testing foobar
13:28:30   Setup
13:28:30     should display foobar - pass
⋮                                                   <--- more describe-s and it-s
13:28:35 Finished in 12.616 seconds
13:28:35 2 tests, 9 assertions, 0 failures
13:28:35 
13:28:35 [launcher] 0 instance(s) of WebDriver still running
13:28:35 [launcher] chrome #1 passed
⋮                                                   <--- other tests scenarios also run successfully
13:28:47 DEBUG - Running with --troubleshoot
13:28:47 DEBUG - Protractor version: 2.1.0
13:28:47 DEBUG - Your base url for tests is http://localhost:34976/
13:28:47 Using ChromeDriver directly...
13:28:47 [launcher] Running 1 instances of WebDriver <--- hanging from here,
                                                          can't figure out why,
                                                          wish I had logs : [
15:05:23 Xvfb stopping                               <--- canceled build manually,
                                                          see time difference, no timeouts triggered,
                                                          neither from Protractor nor from WebDriver : [
15:05:23 Build has been canceled

Note that it is not always the same tests scenario which leads to the hanging.
Same problems with node 0.10.33 as with 0.12.7.
Using Ubuntu 12.04.5 LTS (GNU/Linux 3.13.0-37-generic x86_64).

$ file /opt/google/chrome/chrome
/opt/google/chrome/chrome: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xe4fc0257b42110fc269782274f1e774718135349, stripped

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions