karma-runner / karma-sauce-launcher

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

Tests not working on Sauce Labs #145

Closed Vheissu closed 6 years ago

Vheissu commented 6 years ago

Previously tests were working with with SauceLabs using Karma. However, I am not sure if something has recently changed on the side of SL itself in respect to how tunnels are created for testing.

For some reasons tests just time out, I get the following:

screen shot 2017-10-02 at 11 43 35 pm

Eventually it gives up. The strange thing is tests were working just fine up until recently. All of a sudden all of my repos were failing on the SauceLabs testing part. At first I thought it was an issue with Travis or the Travis config I am using, however I cannot get SauceLabs tests to run locally either (as per screenshot).

Should this plugin still be working? I am on the latest version, but have tried prior versions and still nothing. I tried digging up information on the SauceLabs website, but couldn't find anything relating to changes.

thomasconner commented 6 years ago

I am experiencing the same issue here.

Vheissu commented 6 years ago

@thomasconner Good news, I worked out what is causing this today. I went to the extent of changing my build process and everything. I wrote up a blog post on my experience and how I solved it here: https://ilikekillnerds.com/2017/10/karma-sauce-launcher-issue-tests-timing-outnot-running-sauce-labs/

The TL;DR is remove connectOptions from your sauceLabs configuration object inside of karma.conf.js I think specifying port: 5757 is what causes the issue or possibly the whole connectOptions object is the issue (I didn't dig further after it started working).

jdmarshall commented 6 years ago

I'm not clear on why, but it's documented somewhere that sauce tunnels don't forward every port. You have to pick one of the white-listed port (ranges?) or you get no traffic. Stumbled on that about 18 months ago. Let me see if I can find the relevant docs...

robframpton commented 6 years ago

Ran into the same timeout issue. Rolling back to karma-sauce-launcher@1.1.0 resolved the issue for me.

thetutlage commented 6 years ago

It's not working for me either with bare minimum config and a one test using Mocha. It is not able to make websocket connection ( check attached screenshot for that ).

Config

{
  basePath: '',
  files: [
    // some files
  ],
  logLevel: 'debug',
  port: 9876,
  customLaunchers: customLaunchers,
  reporters: ['dots', 'saucelabs'],
  frameworks: ['mocha'],
  captureTimeout: 300000,
  browserNoActivityTimeout: 300000,
  browserDisconnectTimeout: 100000,
  browserDisconnectTolerance: 1,
  browsers: Object.keys(customLaunchers),
  sauceLabs: {
    testName: 'Karma and Sauce Labs demo'
  },
  singleRun: true
}

Custom launchers

const customLaunchers = {
  sl_chrome: {
    base: 'SauceLabs',
    browserName: 'chrome',
    platform: 'OS X 10.10'
  }
}

Screenshot from saucelabs

screen shot 2017-12-15 at 9 26 53 am
jdmarshall commented 6 years ago

@thetutlage

I was having websockets problems with saucelabs long before I started using karma-sauce-launcher, so my config has:

transports: ['polling'],

That may explain why we aren't experiencing the problem with 1.2.0.

Could one of you run a git bisect and figure out where the problem starts? I wonder if the dependency updates or the proxy additions are involved.

gushiguera-rezi commented 4 years ago

I am seeing this issue with the latest version still (v2.0.2), was it resolved? Removing the configuration options doesn't seem to work.