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

Add configuration for websocket timeout #1176

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

rhpijnacker
Copy link
Contributor

There are cases where it is useful/necessary to set the timeout on acknowledgments from the server when data is sent over the WebSocket.
This PR makes it possible to configure this value.

@codecov-io
Copy link

codecov-io commented Oct 23, 2020

Codecov Report

Merging #1176 into 4.x will decrease coverage by 17.21%.
The diff coverage is 97.05%.

Impacted file tree graph

@@             Coverage Diff             @@
##              4.x    #1176       +/-   ##
===========================================
- Coverage   66.70%   49.48%   -17.22%     
===========================================
  Files          61       61               
  Lines        4980     4987        +7     
  Branches     1109     1111        +2     
===========================================
- Hits         3322     2468      -854     
- Misses       1658     2519      +861     
Impacted Files Coverage Δ
src/lib/RemoteSuite.ts 0.00% <ø> (ø)
src/lib/channels/WebSocket.ts 96.15% <66.66%> (-1.89%) ⬇️
src/lib/common/util.ts 88.61% <100.00%> (+0.02%) ⬆️
src/lib/executors/Node.ts 92.26% <100.00%> (+0.59%) ⬆️
src/loaders/dojo.ts 100.00% <100.00%> (ø)
src/loaders/dojo2.ts 100.00% <100.00%> (ø)
src/loaders/systemjs.ts 95.23% <100.00%> (+0.23%) ⬆️
src/lib/reporters/html/icons.ts 0.00% <0.00%> (-100.00%) ⬇️
src/lib/reporters/Dom.ts 0.00% <0.00%> (-93.45%) ⬇️
src/lib/browser/util.ts 0.00% <0.00%> (-93.43%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef37c6a...3457f55. Read the comment docs.

Copy link
Member

@jason0x43 jason0x43 left a comment

Choose a reason for hiding this comment

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

This is looking good! A couple of the files ended up with Windows line endings -- could you convert those back to \n? (They make the diff huge.) Also, could you add the new socketTimeout option to the schema in src/schemas/config.json?

if (this.timeout == null) {
this.timeout = 10000;
}
this.timeout = options.timeout || 10000;
Copy link
Member

Choose a reason for hiding this comment

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

Prefer ?? over ||.

@jason0x43
Copy link
Member

Thanks for fixing the schema and line endings.

Is there a need to use || in this.timeout = options.timeout || 10000; rather than ???

@rhpijnacker
Copy link
Contributor Author

rhpijnacker commented Oct 30, 2020

When I use ?? it does not compile anymore.
(I commented on that above. Also, I would like your input on some other questions.)

@jason0x43
Copy link
Member

Hmm...what version of TS are you building with (?? is supported by TS 3.7+), and what error does it give you?

@rhpijnacker
Copy link
Contributor Author

Looks like I'm on "Version 3.5.2" (after doing a fresh npm ci).

The error is:

[0] 5:21:12 PM - [tsc:.] src/lib/channels/WebSocket.ts(21,37): error TS1109: Expression expected.
[0] 5:21:12 PM - [tsc:.] src/lib/channels/WebSocket.ts(21,44): error TS1005: ':' expected.
[0] 5:21:12 PM - Error running tsc:., exiting...

@jason0x43
Copy link
Member

Hmmm...yeah, the TS version is set by intern-dev. Let's restore the original logic, then. While ?? is equivalent to the original, || is not (it won't allow a timeout of 0, for example).

@jason0x43 jason0x43 merged commit ae1fb79 into theintern:4.x Nov 3, 2020
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