karma-runner / karma-sauce-launcher

A Karma plugin. Launch any browser on SauceLabs!
MIT License
199 stars 103 forks source link

Error for Safari & Chrome 38 on karma 6.x #239

Closed longlho closed 3 years ago

longlho commented 3 years ago

All tests passed but the build error out and IDK why.

Build: https://app.saucelabs.com/tests/f000b44a703c465e9be79a2ec7ab326c

wswebcreation commented 3 years ago

Hi @longlho

Can you provide some more information, where did it fail?

longlho commented 3 years ago

I believe it failed at the end after all tests are run.

selenium-server.log shows

04:16:46.238 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0'
04:16:46.246 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4443
2021-01-22 04:16:46.595:INFO::main: Logging initialized @1026ms to org.seleniumhq.jetty9.util.log.StdErrLog
04:16:46.945 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4443
04:16:47.255 DEBUG [WebDriverServlet.handle] - Found handler: org.openqa.selenium.remote.server.commandhandler.Status@4b375805
04:16:47.262 DEBUG [WebDriverServlet.lambda$handle$3] - /status: Executing GET on /status (handler: Status)
04:16:47.400 DEBUG [WebDriverServlet.handle] - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@648de2ba
04:16:47.401 DEBUG [WebDriverServlet.lambda$handle$3] - /session: Executing POST on /session (handler: BeginSession)
04:16:47.517 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browserName": "safari",
  "safari.options": {
  },
  "webdriver.remote.quietExceptions": false
}
04:16:47.519 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.safari.SafariDriverService)
04:16:50.642 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
04:16:50.690 DEBUG [RemoteWebDriver.log] - Executing: newSession [null, newSession {desiredCapabilities=Capabilities {acceptInsecureCerts: false, browserName: Safari, browserVersion: 12.0, platformName: macOS, setWindowRect: true}}]
04:16:50.692 DEBUG [RemoteWebDriver.log] - Executed: [null, newSession {desiredCapabilities=Capabilities {acceptInsecureCerts: false, browserName: Safari, browserVersion: 12.0, platformName: macOS, setWindowRect: true}}]
04:16:50.698 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:50.844 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:50.845 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing POST on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/execute (handler: ServicedSession)
04:16:50.888 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":1024}
04:16:50.900 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:50.901 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing POST on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/execute (handler: ServicedSession)
04:16:50.911 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":768}
04:16:50.917 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:50.917 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing POST on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/window/current/position (handler: ServicedSession)
04:16:50.924 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 400 and content: {"value":{"error":"invalid argument","message":"Parameter 'x' has a boolean value, which is not allowed.","stacktrace":""}}
04:16:50.924 DEBUG [W3CHttpResponseCodec.decode] - Processing an error
04:16:50.955 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:50.956 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing POST on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/window/current/size (handler: ServicedSession)
04:16:50.986 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":{"y":23,"x":0,"width":1024,"height":768}}
04:16:50.997 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:50.997 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing POST on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/window/current/maximize (handler: ServicedSession)
04:16:51.018 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":{"y":23,"x":0,"width":1024,"height":745}}
04:16:51.026 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:51.028 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing GET on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/window_handles (handler: ServicedSession)
04:16:51.040 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":["page-5576453C-F5EB-4BBB-9A41-990A85D5B728"]}
04:16:51.189 DEBUG [WebDriverServlet.handle] - Found handler: E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (org.openqa.selenium.safari.SafariDriverService)
04:16:51.190 DEBUG [WebDriverServlet.lambda$handle$3] - Handler thread for session E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC (Safari): Executing POST on /session/E74CEDF3-20C6-4D3A-BF9C-857304DF6AAC/url (handler: ServicedSession)
04:16:52.955 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":null}

Specifically

04:16:50.924 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 400 and content: {"value":{"error":"invalid argument","message":"Parameter 'x' has a boolean value, which is not allowed.","stacktrace":""}}
04:16:50.924 DEBUG [W3CHttpResponseCodec.decode] - Processing an error

although I'm not sure what this was referred to

longlho commented 3 years ago

This is the build link for Chrome 38 which is also failing: https://app.saucelabs.com/tests/e9aafdaf2e794cf9887562e4a235826a

Logs don't seem to show any error yet Custom Data indicates there's an error:

Custom Data:
totalTime: 637
skipped: 0
disconnected: false
success: 92
netTime: 272
failed: 0
startTime: 1611288637983
error: true
total: 92
wswebcreation commented 3 years ago

Thanks @longlho

What about your own server logs? And secondly, is there a reason for testing on Chrome 38? That one is really old

longlho commented 3 years ago

Yes we maintain polyfills so we do need to test on really old browsers. Can you clarify my own server logs? From my build log all I saw (regarding err) was:

22 01 2021 04:16:55.922:ERROR [Safari 12.0 (Mac OS 10.14)]: Some of your tests did a full page reload!
22 01 2021 04:16:55.922:ERROR [reporter.sauce]: ✖ Tests errored

But I'm pretty sure my tests do not reload the page...

wswebcreation commented 3 years ago

Hi @longlho

Hmm, I don't know where the page reload is coming from, but that is the one that is causing the test to be set too failed. Can you share the link of Sauce Labs of that session?

longlho commented 3 years ago

Yup i posted it above

wswebcreation commented 3 years ago

Ok, problem is that I can see it there so can't debug it

longlho commented 3 years ago

hmm any rec on what I can do to help debug?

wswebcreation commented 3 years ago

@longlho

I've released a new version that will add the old logs back to Sauce Labs, that one might give more insights where the reload is coming from, can you update to this version and see what happens, see https://github.com/karma-runner/karma-sauce-launcher/compare/v4.3.4...v4.3.5

thanks

longlho commented 3 years ago

ok I tried 4.3.5. The build URLs are:

wswebcreation commented 3 years ago

Hi @longlho

I've been looking into this and it looks like it's something from Karma and or your testcode instead of an issue with the service. There is no webdriver command going to the browsers that would initiate this reload, so they only thing I can conclude is that there is a page reload in the test / karma is triggering this. I've try to find some posts about Some of your tests did a full page reload! and I see some same issues which all refer to the script itself

longlho commented 3 years ago

@wswebcreation looks like https://github.com/karma-runner/karma/pull/3643 fixed this! Thanks for looking

wswebcreation commented 3 years ago

Thanks for getting back on this @longlho