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

Slow on Windows #976

Closed
panuhorsmalahti opened this issue Jan 25, 2016 · 7 comments
Closed

Slow on Windows #976

panuhorsmalahti opened this issue Jan 25, 2016 · 7 comments

Comments

@panuhorsmalahti
Copy link

There was an issue about slow execution of tests on Windows:
https://github.com/Polymer/web-component-tester/issues/169

However, the issue persists. Perhaps it's slightly faster now, though.

The reason appears to be that even though launchpad immediately finds the browser required for running tests (in my case Chrome), it takes a long time to find all the available browsers.

You can see the logs below (I've added some extra logging too):

wct-local/lib/browsers.js detect
Initializing local launchers undefined
wct-local/lib/browsers.js detect - local response
launchpad/lib/local/index.js browsers() called
Caching discovery for local browser aurora
Caching discovery for local browser canary
Caching discovery for local browser chrome
Caching discovery for local browser firefox
Caching discovery for local browser ie
Caching discovery for local browser nodeWebkit
Caching discovery for local browser opera
Caching discovery for local browser phantom
Mon Jan 25 2016 17:06:03 GMT+0200 (FLE Standard Time): waiting for 8 browsers
checking default locations
locations: ["C:\\Program Files (x86)\\Aurora\\firefox.exe"]
envLocation: undefined
checking default locations
locations: ["C:\\Program Files (x86)\\Google\\Chrome SxS\\Application\\chrome.exe","C:\\Users\\pahor1\\AppData\\Roaming\\Google\\Chrome SxS\\Application\\chrome.exe"]
envLocation: undefined
checking default locations
locations: ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Users\\pahor1\\AppData\\Roaming\\Google\\Chrome\\Application\\chrome.exe"]
envLocation: undefined
Found browser chrome in C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
checking default locations
locations: ["C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"]
envLocation: undefined
Found browser firefox in C:\Program Files (x86)\Mozilla Firefox\firefox.exe
checking default locations
locations: ["C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe"]
envLocation: undefined
Found browser ie in C:\Program Files (x86)\Internet Explorer\iexplore.exe
checking default locations
locations: []
envLocation: undefined
checking default locations
locations: ["C:\\Program Files (x86)\\Opera\\launcher.exe"]
envLocation: undefined
checking default locations
locations: ["C:\\Program Files (x86)\\phantomjs\\phantomjs.exe"]
envLocation: undefined
Retrieving version for windows executable "c:\Projects\OWL\rsp\owl-component-service\node_modules\launchpad\resources\ShowVer.exe" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Retrieving version for windows executable "c:\Projects\OWL\rsp\owl-component-service\node_modules\launchpad\resources\ShowVer.exe" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
Retrieving version for windows executable "c:\Projects\OWL\rsp\owl-component-service\node_modules\launchpad\resources\ShowVer.exe" "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Found browser version chrome 48.0.2564.82
Found browser version ie 11.0.9600.16384
Found browser version firefox 43.0.4.0
Ran pathQuery for phantom dir /s /b phantomjs.exe C:\Programs\phantomjs-1.9.8-windows\phantomjs-1.9.8-windows\phantomjs.exe
Retrieving version for windows executable "c:\Projects\OWL\rsp\owl-component-service\node_modules\launchpad\resources\ShowVer.exe" "C:\Programs\phantomjs-1.9.8-windows\phantomjs-1.9.8-windows\phantomjs.exe"
Ran pathQuery for opera dir /s /b opera.exe C:\Program Files\Opera x64\opera.exe
Retrieving version for windows executable "c:\Projects\OWL\rsp\owl-component-service\node_modules\launchpad\resources\ShowVer.exe" "C:\Program Files\Opera x64\opera.exe"
Found browser version opera 12.0.0.0
Found browser version phantom 1.9.8.0
Mon Jan 25 2016 17:07:12 GMT+0200 (FLE Standard Time)Listed all browsers (before normalization) [ null,
  null,
  { name: 'chrome',
    defaultLocation:
     [ 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
       'C:\\Users\\pahor1\\AppData\\Roaming\\Google\\Chrome\\Application\\chrome.exe' ],
    pathQuery: 'dir /s /b chrome.exe',
    cwd: 'C:\\',
    opensTab: true,
    path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
    binPath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
    command: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
    version: '48.0.2564.82' },
  { name: 'firefox',
    defaultLocation: 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe',
    pathQuery: 'dir /s /b firefox.exe',
    cwd: 'C:\\',
    opensTab: true,
    path: 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe',
    binPath: 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe',
    command: 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe',
    version: '43.0.4.0' },
  { name: 'ie',
    defaultLocation: 'C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe',
    pathQuery: 'dir /s /b iexplore.exe',
    cwd: 'C:\\',
    path: 'C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe',
    binPath: 'C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe',
    command: 'C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe',
    version: '11.0.9600.16384' },
  null,
  { name: 'opera',
    defaultLocation: 'C:\\Program Files (x86)\\Opera\\launcher.exe',
    pathQuery: 'dir /s /b opera.exe',
    cwd: 'C:\\',
    imageName: 'opera.exe',
    opensTab: true,
    path: 'C:\\Program Files\\Opera x64\\opera.exe',
    binPath: 'C:\\Program Files\\Opera x64\\opera.exe',
    command: 'C:\\Program Files\\Opera x64\\opera.exe',
    version: '12.0.0.0' },
  { name: 'phantom',
    defaultLocation: 'C:\\Program Files (x86)\\phantomjs\\phantomjs.exe',
    pathQuery: 'dir /s /b phantomjs.exe',
    args: [ 'c:\\Projects\\OWL\\rsp\\owl-component-service\\node_modules\\launchpad\\resources\\phantom.js' ],
    multi: true,
    cwd: 'C:\\',
    path: 'C:\\Programs\\phantomjs-1.9.8-windows\\phantomjs-1.9.8-windows\\phantomjs.exe',
    binPath: 'C:\\Programs\\phantomjs-1.9.8-windows\\phantomjs-1.9.8-windows\\phantomjs.exe',
    command: 'C:\\Programs\\phantomjs-1.9.8-windows\\phantomjs-1.9.8-windows\\phantomjs.exe',
    version: '1.9.8.0' } ]
wct-local/lib/browsers.js detect - browsers response
wct-local browsers.js module.exports.detect()
Installing and starting Selenium server for local browsers

The slow step here is from 17:06:03 to 17:07:12, e.g. more than a minute

My proposed fix is for the api.browsers function in launchpad to take in an optional argument specifying which browsers to find, and for wct-local to supply these based on the configuration.

@panuhorsmalahti
Copy link
Author

To make it clear, the program is waiting on this asynchronous call:
https://github.com/Polymer/wct-local/blob/master/lib/browsers.js#L83

which in turn is waiting on this array of promises:
https://github.com/ekryski/launchpad/blob/master/lib/local/index.js#L64

The deferreds array corresponds to the browsers defined here:
https://github.com/ekryski/launchpad/blob/master/lib/local/platform/index.js#L4

which on windows are defined here:
https://github.com/ekryski/launchpad/blob/master/lib/local/platform/windows.js#L7

@panuhorsmalahti
Copy link
Author

See the launchpad issue for an alternative fix proposal of using the known browsers from the configuration file if they exist, otherwise falling back to the slow api.browsers call.

@mazswojejzony
Copy link

Another option to speed-up the browser detection is to use launchpad's env variables:
https://github.com/ekryski/launchpad#environment-variables-impacting-local-browsers-detection

@AlexKeySmith
Copy link

Unfortunately the launchpad environmental variables didn't help for me, has it helped others on this thread?

@sashafirsov
Copy link

sashafirsov commented May 26, 2018

The following environment variable values have saved me in Win10 environment:

LAUNCHPAD_BROWSERS=chrome

LAUNCHPAD_CHROME=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

It is not obvious from Polymer and launchpad documentation the need to set only single browser with known location to minimize the test run time during ongoing development. Of course for multiple browsers it will take more time and traverse over all PATH with guess on all possible browsers takes forever. It would be reasonable not to rely on auto-detection and list in LAUNCHPAD_BROWSERS only browsers you have set the LAUNCHPAD_xxx location.

@aomarks aomarks transferred this issue from Polymer/wct-local Jan 3, 2019
@stale
Copy link

stale bot commented Mar 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 4, 2020
@stale
Copy link

stale bot commented Apr 30, 2022

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants