karma-runner / karma-sauce-launcher

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

Uncaught TypeError: Cannot read property 'deleteSession' of null #236

Open Krinkle opened 3 years ago

Krinkle commented 3 years ago

Environment:

Example at https://github.com/Krinkle/kiwix-js/runs/1620210786?check_suite_focus=true

Tue, 29 Dec 2020 04:22:39 GMT > karma start tests/karma.conf.saucelabs.js

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: firefox   on SauceLabs have not captured in 60000 ms, killing.
Tue, 29 Dec 2020 04:23:40 GMT … ERROR [SaucelabsLauncher]: Could not quit the Saucelabs selenium connection.
  Failure message:
  TypeError: Cannot read property 'deleteSession' of null
    at SaucelabsLauncher.<anonymous> (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:139:26)
    at Generator.next (<anonymous>)
    at /home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:4:12)
    at SaucelabsLauncher.<anonymous> (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:131:31)
    at SaucelabsLauncher.emit (events.js:315:20)
    at SaucelabsLauncher.EventEmitter.emit (domain.js:486:12)
    at SaucelabsLauncher.emitAsync (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma/lib/events.js:52:10)
    at SaucelabsLauncher.BaseLauncher.kill (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma/lib/launchers/base.js:61:27)

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: chrome   on SauceLabs have not captured in 60000 ms, killing.
…

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: MicrosoftEdge 15.15063  on SauceLabs have not captured in 60000 ms, killing.
…

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: MicrosoftEdge 18.17763  on SauceLabs have not captured in 60000 ms, killing.
…

It works fine from my machine with Node.js 10.15.2 on Debian 9 Stretch (via Docker for Mac), and it used to work fine on Travis CI, but now on GitHub Actions I can't get it work.

I've tried everything I could think of, including different Node.js versions and the latest versions of dependencies, and verifying that credentials are making it through.

As you can see from the timestamps, it happens immediately upon startup, so contrary to the warning, it is not a timeout. (The error message itself might be a secondary problem, as that led to some additional confusion initially.)

Krinkle commented 3 years ago

Nevermind. I eventually figured out that the issue was that the connection wasn't being estalished in the first place because the SAUCE_ACCESS_KEY was missing. I mistakenly assumed that GitHub Actions would work similarly to Travis CI and allow forked repositories to provide their own secrets. But, despite GitHub happily allowing you to configure secrets in a forked repo, these are completely ignored.

It might be good if karma-sauce-launcher would give a better error message since there is nothing in the above that suggests incorrect or missing credentials, or indeed anything about the connection not being established.

The two errors shown are both "wrong", there is no 60s timeout reached, and there is no issue in quiting the connection. There was never a connection in the first place.

If that's a valid issue and not an upstream issue, great. Otherwise, feel free to close this :)

sakshiiii38 commented 3 years ago

I want to work on this issue as I am new so please guide me through.