Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

getting Timed out error after switching to use --npm #3260

Open hekod777 opened 6 years ago

hekod777 commented 6 years ago

I am trying to move our polymer dependencies from bower to npm

With the following imports in the test.html

    <script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
    <script src="../node_modules/web-component-tester/browser.js"></script>

    <link rel="import" href="../node_modules/@polymer/iron-test-helpers/mock-interactions.html">
    <link rel="import" href="../node_modules/@polymer/iron-test-helpers/test-helpers.html">

polymer test worked successfully with bower_components folder.

but polymer test --npm or wct --npm both gave me a Timed out error after about 1 minute.

I have tried wct 6.4.0, 6.5.0, 6.6.0-pre.5, all have this issue.

here is the verbose log:

step: loadPlugins
step: configure
hook: configure
Expanded local browsers: [ 'chrome', 'safari' ] into capabilities: [ { browserName: 'chrome',
    version: '66',
    chromeOptions: 
     { binary: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
       args: [Array] } },
  { browserName: 'safari',
    version: '11.1',
    'safari.options': { skipExtensionInstallation: true } } ] with browserOptions: undefined
configuration: { suites: [ 'test/dprd-button_test.html' ],
  verbose: true,
  quiet: false,
  expanded: false,
  testTimeout: 90000,
  persistent: false,
  extraScripts: [],
  clientOptions: { root: '/components/', verbose: true },
  compile: 'auto',
  activeBrowsers: 
   [ { browserName: 'chrome', version: '66', chromeOptions: [Object] },
     { browserName: 'safari',
       version: '11.1',
       'safari.options': [Object] } ],
  browserOptions: {},
  plugins: 
   { local: 
      { disabled: false,
        browsers: [Array],
        seleniumArgs: [],
        skipSeleniumInstall: false },
     sauce: { disabled: false } },
  registerHooks: [Function: registerHooks],
  enforceJsonConf: false,
  webserver: 
   { hostname: 'localhost',
     _generatedIndexContent: '<!doctype html>\n<html>\n\n<head>\n  <meta charset="utf-8">\n  <script>\n    WCT = {"root":"/components/","verbose":true};\n  </script>\n  <script>\n    window.__generatedByWct = true;\n  </script>\n  <script src="../web-component-tester/browser.js"></script>\n  \n  \n</head>\n\n<body>\n  <script>\n    WCT.loadSuites(["test/dprd-button_test.html"]);\n  </script>\n</body>\n\n</html>\n' },
  root: '/Users/sicoh001/GitHub/no-bower/dprd-button',
  ttyOutput: true,
  npm: true,
  _: [],
  origSuites: [ 'test/' ] }
hook: prepare
hook: prepare:selenium
Installing and starting Selenium server for local browsers
----------
selenium-standalone installation starting
----------

---
selenium install:
from: https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar
to: /Users/sicoh001/GitHub/no-bower/dprd-button/node_modules/selenium-standalone/.selenium/selenium-server/3.8.1-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.37/chromedriver_mac64.zip
to: /Users/sicoh001/GitHub/no-bower/dprd-button/node_modules/selenium-standalone/.selenium/chromedriver/2.37-x64-chromedriver
---
firefox install:
from: https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-macos.tar.gz
to: /Users/sicoh001/GitHub/no-bower/dprd-button/node_modules/selenium-standalone/.selenium/geckodriver/0.20.0-x64-geckodriver
---
File from https://chromedriver.storage.googleapis.com/2.37/chromedriver_mac64.zip has already been downloaded
---
File from https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar has already been downloaded
---
File from https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-macos.tar.gz has already been downloaded

-----
selenium-standalone installation finished
-----
16:47:43.300 INFO - Selenium build info: version: '3.8.1', revision: '6e95a6684b'
16:47:43.300 INFO - Launching a standalone Selenium Server
2018-05-07 16:47:43.379:INFO::main: Logging initialized @280ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:47:43.409 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
16:47:43.424 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
16:47:43.426 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
16:47:43.427 INFO - Driver class not found: com.opera.core.systems.OperaDriver
16:47:43.427 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
16:47:43.428 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
16:47:43.428 INFO - Driver class not found: org.openqa.selenium.phantomjs.PhantomJSDriver
16:47:43.456 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
 registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: } does not match the current platform MAC
16:47:43.456 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
 registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: } does not match the current platform MAC
16:47:43.489 INFO - Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
16:47:43.490 INFO - Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
16:47:43.490 INFO - Using `new FirefoxOptions()` is preferred to `DesiredCapabilities.firefox()`
16:47:43.491 INFO - Using `new OperaOptions()` is preferred to `DesiredCapabilities.operaBlink()`
16:47:43.491 INFO - Using `new SafariOptions()` is preferred to `DesiredCapabilities.safari()`
16:47:43.499 INFO - Using the passthrough mode handler
2018-05-07 16:47:43.522:INFO:osjs.Server:main: jetty-9.4.7.v20170914
2018-05-07 16:47:43.541:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.ServletContextHandler@b7dd107{/,null,STARTING} has uncovered http methods for path: /
2018-05-07 16:47:43.546:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@b7dd107{/,null,AVAILABLE}
2018-05-07 16:47:43.569:INFO:osjs.AbstractConnector:main: Started ServerConnector@5c072e3f{HTTP/1.1,[http/1.1]}{0.0.0.0:54133}
2018-05-07 16:47:43.569:INFO:osjs.Server:main: Started @471ms
16:47:43.569 INFO - Selenium Server is up and running
2018-05-07 16:47:43.655:INFO:osjshC.ROOT:qtp184966243-14: org.openqa.selenium.remote.server.WebDriverServlet-56aac163: Initialising WebDriverServlet
16:47:43.692 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.Status@2bd7b828
16:47:43.696 INFO - /status: Executing GET on /status (handler: Status)
Selenium server running on port 54133
hook: define:webserver
hook: prepare:webserver
step: runTests
chrome 66                CALL init({"browserName":"chrome","version":"66","chromeOptions":{"binary":"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","args":["start-maximized"]},"variant":""})
chrome 66                POST /session {"desiredCapabilities":{"browserName":"chrome","version":"66","chromeOptions":{"binary":"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","args":["start-maximized"]},"variant":"","javascriptEnabled":true,"platform":"ANY"}}
safari 11.1              CALL init({"browserName":"safari","version":"11.1","safari.options":{"skipExtensionInstallation":true},"variant":""})
safari 11.1              POST /session {"desiredCapabilities":{"browserName":"safari","version":"11.1","safari.options":{"skipExtensionInstallation":true},"variant":"","javascriptEnabled":true,"platform":"ANY"}}
16:47:43.749 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@71835545
16:47:43.749 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@32565ce5
16:47:43.750 INFO - /session: Executing POST on /session (handler: BeginSession)
16:47:43.750 INFO - /session: Executing POST on /session (handler: BeginSession)
16:47:43.798 INFO - Capabilities are: Capabilities {browserName: safari, javascriptEnabled: true, safari.options: {skipExtensionInstallation: true}, variant: , version: 11.1}
16:47:43.798 INFO - Capabilities are: Capabilities {browserName: chrome, chromeOptions: {args: [start-maximized], binary: /Applications/Google Chrome...}, javascriptEnabled: true, variant: , version: 66}
16:47:43.800 INFO - Capabilities {browserName: chrome, chromeOptions: {args: [start-maximized], binary: /Applications/Google Chrome...}, javascriptEnabled: true, variant: , version: 66} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
16:47:43.800 INFO - Capabilities {browserName: safari, javascriptEnabled: true, safari.options: {skipExtensionInstallation: true}, variant: , version: 11.1} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.safari.SafariDriverService)
Starting ChromeDriver 2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85) on port 47476
Only local connections are allowed.
16:47:44.763 INFO - Detected dialect: OSS
safari 11.1              RESPONSE init({"browserName":"safari","version":"11.1","safari.options":{"skipExtensionInstallation":true},"variant":""})
safari 11.1              CALL get("http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=1")
safari 11.1              POST /session/:sessionID/url {"url":"http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=1"}
16:47:45.146 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@7a41ab5b
16:47:45.147 INFO - Handler thread for session 1721A3FD-5499-4D05-B765-258F0D63047C (safari): Executing POST on /session/1721A3FD-5499-4D05-B765-258F0D63047C/url (handler: ServicedSession)
16:47:45.150 INFO - To upstream: {"url":"http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=1"}
16:47:45.485 INFO - Detected dialect: OSS
Test client opened sideband socket
16:47:45.509 INFO - To downstream: {"status":0,"sessionId":"1721A3FD-5499-4D05-B765-258F0D63047C","value":{}}
safari 11.1              RESPONSE get("http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=1")
safari 11.1              Beginning tests via http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=1
safari 11.1              CALL maximize()
safari 11.1              POST /session/:sessionID/window/function%20(err)%20%7B%0A%20%20%20%20%20%20if(err)%20%7B%0A%20%20%20%20%20%20%20%20err.message%20=%20%27[%27%20+%20name%20+%20niceArgs(fargs.all)%20+%20%22]%20%22%20+%20err.message;%0A%20%20%20%20%20%20%20%20if(fargs.callback)%20%7B%20fargs.callback(err);%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20var%20cbArgs%20=%20__slice.call(arguments,%200);%0A%20%20%20%20%20%20%20%20_this.emit(%27command%27,%20%22RESPONSE%22%20,%20name%20+%20niceArgs(fargs.all),%0A%20%20%20%20%20%20%20%20%20%20niceResp(_.drop(cbArgs)));%0A%20%20%20%20%20%20%20%20if(fargs.callback)%20%7B%20fargs.callback.apply(null,%20cbArgs);%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D/maximize
16:47:45.530 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@7a41ab5b
16:47:45.532 INFO - Handler thread for session 1721A3FD-5499-4D05-B765-258F0D63047C (safari): Executing POST on /session/1721A3FD-5499-4D05-B765-258F0D63047C/window/function (err) {
      if(err) {
        err.message = '[' + name + niceArgs(fargs.all) + "] " + err.message/maximize (handler: ServicedSession)
chrome 66                RESPONSE init({"browserName":"chrome","version":"66","chromeOptions":{"binary":"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","args":["start-maximized"]},"variant":""})
chrome 66                CALL get("http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=0")
chrome 66                POST /session/:sessionID/url {"url":"http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=0"}
16:47:45.533 INFO - To upstream: {}
16:47:45.536 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@19e3aacb
16:47:45.537 INFO - Handler thread for session 5da6d101e1e186453a10d0f30f7d813e (chrome): Executing POST on /session/5da6d101e1e186453a10d0f30f7d813e/url (handler: ServicedSession)
16:47:45.538 INFO - To upstream: {"url":"http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=0"}
safari failed to maximize
Test client opened sideband socket
chrome 66                Beginning tests via http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=0
chrome 66                CALL maximize()
chrome 66                POST /session/:sessionID/window/function%20(err)%20%7B%0A%20%20%20%20%20%20if(err)%20%7B%0A%20%20%20%20%20%20%20%20err.message%20=%20%27[%27%20+%20name%20+%20niceArgs(fargs.all)%20+%20%22]%20%22%20+%20err.message;%0A%20%20%20%20%20%20%20%20if(fargs.callback)%20%7B%20fargs.callback(err);%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20var%20cbArgs%20=%20__slice.call(arguments,%200);%0A%20%20%20%20%20%20%20%20_this.emit(%27command%27,%20%22RESPONSE%22%20,%20name%20+%20niceArgs(fargs.all),%0A%20%20%20%20%20%20%20%20%20%20niceResp(_.drop(cbArgs)));%0A%20%20%20%20%20%20%20%20if(fargs.callback)%20%7B%20fargs.callback.apply(null,%20cbArgs);%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D/maximize
16:47:46.029 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@19e3aacb
16:47:46.029 INFO - Handler thread for session 5da6d101e1e186453a10d0f30f7d813e (chrome): Executing POST on /session/5da6d101e1e186453a10d0f30f7d813e/window/function (err) {
      if(err) {
        err.message = '[' + name + niceArgs(fargs.all) + "] " + err.message/maximize (handler: ServicedSession)
16:47:46.031 INFO - To upstream: {}
chrome failed to maximize
16:47:46.084 INFO - To downstream: {"sessionId":"5da6d101e1e186453a10d0f30f7d813e","status":0,"value":null}
chrome 66                RESPONSE get("http://localhost:8081/components/dprd-button/generated-index.html?cli_browser_id=0")
safari 11.1              CALL title()
safari 11.1              GET /session/:sessionID/title
16:48:30.532 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@7a41ab5b
16:48:30.532 INFO - Handler thread for session 1721A3FD-5499-4D05-B765-258F0D63047C (safari): Executing GET on /session/1721A3FD-5499-4D05-B765-258F0D63047C/title (handler: ServicedSession)
16:48:30.536 INFO - To downstream: {"status":0,"sessionId":"1721A3FD-5499-4D05-B765-258F0D63047C","value":""}
safari 11.1              RESPONSE title()
chrome 66                CALL title()
chrome 66                GET /session/:sessionID/title
16:48:31.032 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@19e3aacb
16:48:31.032 INFO - Handler thread for session 5da6d101e1e186453a10d0f30f7d813e (chrome): Executing GET on /session/5da6d101e1e186453a10d0f30f7d813e/title (handler: ServicedSession)
16:48:31.039 INFO - To downstream: {"sessionId":"5da6d101e1e186453a10d0f30f7d813e","status":0,"value":""}
chrome 66                RESPONSE title()
safari 11.1              CALL title()
safari 11.1              GET /session/:sessionID/title
16:49:15.532 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@7a41ab5b
16:49:15.532 INFO - Handler thread for session 1721A3FD-5499-4D05-B765-258F0D63047C (safari): Executing GET on /session/1721A3FD-5499-4D05-B765-258F0D63047C/title (handler: ServicedSession)
16:49:15.536 INFO - To downstream: {"status":0,"sessionId":"1721A3FD-5499-4D05-B765-258F0D63047C","value":""}
safari 11.1              RESPONSE title()
safari 11.1              Tests failed: Timed out
safari 11.1              CALL quit()
safari 11.1              DELETE /session/:sessionID
16:49:15.554 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@7a41ab5b
16:49:15.555 INFO - Handler thread for session 1721A3FD-5499-4D05-B765-258F0D63047C (safari): Executing DELETE on /session/1721A3FD-5499-4D05-B765-258F0D63047C (handler: ServicedSession)
16:49:15.557 INFO - To downstream: {"status":0,"sessionId":"1721A3FD-5499-4D05-B765-258F0D63047C","value":{}}
safari 11.1              RESPONSE quit()
safari 11.1              BrowserRunner complete
16:49:15.559 INFO - Removing session org.openqa.selenium.remote.server.ServicedSession@7a41ab5b
16:49:15.564 INFO - To downstream: A session with id = '1721A3FD-5499-4D05-B765-258F0D63047C' was not found.
chrome 66                CALL title()
chrome 66                GET /session/:sessionID/title
16:49:16.034 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@19e3aacb
16:49:16.034 INFO - Handler thread for session 5da6d101e1e186453a10d0f30f7d813e (chrome): Executing GET on /session/5da6d101e1e186453a10d0f30f7d813e/title (handler: ServicedSession)
16:49:16.037 INFO - To downstream: {"sessionId":"5da6d101e1e186453a10d0f30f7d813e","status":0,"value":""}
chrome 66                RESPONSE title()
chrome 66                Tests failed: Timed out
chrome 66                CALL quit()
chrome 66                DELETE /session/:sessionID
16:49:16.089 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@19e3aacb
16:49:16.089 INFO - Handler thread for session 5da6d101e1e186453a10d0f30f7d813e (chrome): Executing DELETE on /session/5da6d101e1e186453a10d0f30f7d813e (handler: ServicedSession)
16:49:16.140 INFO - To downstream: {"sessionId":"5da6d101e1e186453a10d0f30f7d813e","status":0,"value":null}
chrome 66                RESPONSE quit()
chrome 66                BrowserRunner complete
Test run ended in failure: Timed out
hook: cleanup

chrome 66 (error)                       safari 11.1 (error)                   

Error: Timed out

Any ideas how to get it to work?

lemoustachiste commented 6 years ago

Could you try and look at the automatically opened Chrome browser, in the console, and see which error you are getting?

I have a similar issue, my test suite fails on a timeout too, trying to run a test with a11ySuite.

In my console I see the error:


at Suite.a11ySuite.eachTest (a11ySuite.js:51)
at mocha.js:1550
at Object.exports.forEach (mocha.js:1595)
at Suite.eachTest (mocha.js:1550)
at Runner.grepTotal (mocha.js:1224)
at Runner.grep (mocha.js:1215)
at new Runner (mocha.js:1197)
at Mocha.run (mocha.js:592)
at _runMocha (extend.js:41)
at done (util.js:34)```

More details here: https://stackoverflow.com/questions/50517884/polymer-3-0-a11ysuite-testing-error
stale[bot] commented 4 years ago

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.

tdumitrescu commented 4 years ago

In case this helps anyone, we had a similar timeout issue when upgrading to wct 6 and enabling the npm option. Inspection of the network requests in the browser showed that it was hanging for a long time waiting for our JS bundles from the local Polyserve server. Turned out it was trying to auto-transpile our (already-preprocessed) files with Babel. Turning off the auto-transpilation worked to return us to a reasonable startup time, with the options {compile: 'never', moduleResolution: 'none'}.

stale[bot] commented 3 years ago

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.