Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A guide to fixing "Why won't my tests run on Windows?" #337

Open
imlucas opened this issue Oct 26, 2018 · 3 comments
Open

A guide to fixing "Why won't my tests run on Windows?" #337

imlucas opened this issue Oct 26, 2018 · 3 comments

Comments

@imlucas
Copy link

imlucas commented Oct 26, 2018

There are several issues open around spectron on windows oddities; chromedriver timing out, app failed to initialize and more (examples below). Having spent the past week digging around and fixing this for MongoDB Compass's testing, I found and fixed an issue I hadn't seen reported elsewhere: The command line is too long. buried in the chromedriver logs causing app.start() to hang or fail with various timeout errors. The full details are in mongodb-js/hadron-spectron#3 but the tldr is:

  1. Check the electron ➡️ spectron version map!
  2. Enable and carefully study the chromedriver logs, specifically look for ERROR, SEVERE, WARNING, command line is too long
  3. Be careful when passing env: process.env to the Application constructor... this is what was causing the silent, fatal command line is too long for me
  4. This is as far as I needed to go. If anyone else has other fixes, I'd love to hear in comments for the sake of my future, stuck-debugging self 😺

@MarshallOfSound I'd send a PR for this but wasn't quite sure where it should go. README perhaps? I've just noticed a ton of these "Won't work on Windows issues" and wanted to help the reporters get unblocked.

#219 #144 probably others?

@lottec
Copy link

lottec commented Nov 23, 2018

To add to this, I just spent so much time trying to debug why my, while working fine on OSX, on Windows my spectron tests were timing out on the beforeEach hook (where I was calling app.start() on the spectron Application instance). Turns out it works just fine with mocha but not with electron-mocha, which we're using for unit tests...

@imlucas
Copy link
Author

imlucas commented Dec 7, 2018

@lottec hmm. which version of electron-mocha are you on? 6.0.x works for me.

@imlucas
Copy link
Author

imlucas commented Dec 7, 2018

I have this all working locally... But in our CI running under cygwin... no such luck...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants