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

feat(config): Add config option for browser socket timeout #3102

Merged
merged 2 commits into from
Aug 13, 2018
Merged

feat(config): Add config option for browser socket timeout #3102

merged 2 commits into from
Aug 13, 2018

Conversation

ndcornelius
Copy link
Contributor

Sometimes the default timeout for the SocketIO connection attempt isn't enough. There have specifically been issues with the default value of 2000 ms when running with ChromeHeadless. Increasing the timeout value seems to solve this issue in a large number of cases.

This change makes the client timeout value a configuration option. It leaves the default as 2000 ms, but allows for modifying the value if the default is not enough for the browser and environment combination that is targeted.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@ndcornelius
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

Copy link
Contributor

@johnjbarton johnjbarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we know that this change was successful?

If you set the timeout to 1ms, what do you see in a test?

## browserSocketTimeout
**Type:** Number

**Default:** `2000`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default provided upstream in socket.io is 20000. Is there any reason we should not use this default as well?

To me, at worst the extra time will mean that, should the karma server die after launching the browser, the test will last another 18secs. That seems like a small cost for an unusual case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the default to 20000 in PR #3103 so just change the value here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

to connect.

When running a browser in different environments, it can take different amounts of time for the
client socket to connect. If Karma cannot connect within the default timeout, you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a sentence explaining what a user will see in the case that the timeout is too small.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

johnjbarton added a commit to johnjbarton/karma that referenced this pull request Aug 7, 2018
Log something on all disconnect() calls.
Up the timeout as suggested by ndcornelius@ on karma-runner#3102
johnjbarton added a commit to johnjbarton/karma that referenced this pull request Aug 7, 2018
Log something on all disconnect() calls.
Up the timeout as suggested by ndcornelius@ on karma-runner#3102
johnjbarton added a commit that referenced this pull request Aug 7, 2018
Log something on all disconnect() calls.
Up the timeout as suggested by ndcornelius@ on #3102
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

Add a configuration option that allows modification
of the default timeout value for the client socket
connection. The previous hardcoded value of 2000
(ms) was insufficent for some environments.

Closes #2927
@googlebot
Copy link

CLAs look good, thanks!

Copy link
Contributor

@johnjbarton johnjbarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants