• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

Karma and Sauce Launcher Issue (tests timing out/not running on Sauce Labs)

Front End Development · October 10, 2017

This is a bug I recently encountered with Karma and the Karma Sauce Launcher plugin. It plagued me for a week, finally I worked out the issue and I had to share the solution incase anyone else encountered the same thing.

The issue I encountered was none of the SauceLabs tests would run. It would say it was spinning up a remote browser on SauceLabs, but no proxy was being created and eventually everything would just time out.

Looking in my network activity suggested requests were not being made, almost as if something else was stopping them. I had debug mode on and there were no errors, just nothing.

Interestingly, in the console I would see POST requests being made to /session with the appropriate options as per SauceLabs’ documentation on making proxy requests. These POST requests were not actually being made, no links to view the remote test and nothing in the SauceLabs console either.

If you don’t want to read what I tried and just want the solution, skip to the section below titled “The solution” for how I fixed it.

Inside of my karma.conf.js file I had the following in my SauceLabs object:

sauceLabs: {
  tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
  username: process.env.SAUCE_USERNAME,
  accessKey: process.env.SAUCE_ACCESS_KEY,
  startConnect: false,
  connectOptions: {
    port: 5757,
    logile: "sauce_connect.log"
  }
},

A pretty standard looking SauceLabs configuration object. Also, more interestingly is this worked up until recently and then seemingly stopped working across multiple repos on a client project I was working on. Truly a perplexing situation.

I tried everything (and I mean everything):

  • Downgrading Node to different versions (current to stable and every incremental version)
  • Trying out different versions of Karma and the Karma Sauce Launcher plugin
  • Using different Karma plugins as part of my build process; karma-typescript, karma-requirejs, karma-browserify and karma-webpack
  • Attempting to start a Karma server via a Gulpfile.js
  • Tweaking the Travis CI configuration

None of this worked. I was beginning to panic, almost ready to throw in the towel and started looking into Crossbrowsertesting as an alternative instead of SauceLabs.

Then, by chance I accidentally solved the issue.

The solution

Remove the connectOptions section from your SauceLabs object:

connectOptions: {
    port: 5757,
    logile: "sauce_connect.log"
}
 

I didn’t actually bother testing it, but I suspect the port is wrong. I couldn’t find anything that suggest anything had changed, but I did find a few references to port 4445 that SauceLabs listens on. Perhaps this is the new port you specify and 5757 is deprecated.

Or maybe, the issue was the connectOptions were overriding some important defaults? Who knows, all I know is that it fixed the issue and if I saved you a week or more worth of debugging then I am happy.

Dwayne

Leave a Reply Cancel reply

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Here
Here
5 years ago

Wow i can’t thank you enough, i have been experiencing same issue, the time out felt like hell, thanks for posting this…

0
Lee
Lee
4 years ago

You saved my week.

0

Primary Sidebar

Popular

  • Testing Event Listeners In Jest (Without Using A Library)
  • How To Get The Hash of A File In Node.js
  • Waiting for an Element to Exist With JavaScript
  • Thoughts on the Flipper Zero
  • How To Get Last 4 Digits of A Credit Card Number in Javascript
  • How To Paginate An Array In Javascript
  • How To Mock uuid In Jest
  • How to Copy Files Using the Copy Webpack Plugin (without copying the entire folder structure)
  • Reliably waiting for network responses in Playwright
  • Wild Natural Deodorant Review

Recent Comments

  • Dwayne on Is Asking Developers How to Write FizzBuzz Outdated?
  • kevmeister68 on Is Asking Developers How to Write FizzBuzz Outdated?
  • Kevmeister68 on Start-Ups and Companies That Embrace Work From Anywhere Will Be More Likely to Survive the Coming Recession in 2023
  • kevmeister68 on What Would Get People Back Into the Office?
  • Dwayne on PHP Will Not Die

Copyright © 2023 · Dwayne Charrington · Log in

wpDiscuz