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

don't use external service for testing websockets #1138

Merged
merged 4 commits into from
Sep 4, 2019

Conversation

mstoykov
Copy link
Collaborator

@mstoykov mstoykov commented Sep 2, 2019

part of #537

@mstoykov mstoykov requested review from na--, imiric and cuonglm and removed request for na-- September 2, 2019 13:09
na--
na-- previously approved these changes Sep 2, 2019
Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

LGTM. You mentioned something about moving the httpmultibin to its own package - do you want to do it in this PR, or in a separate PR, and then merge the resulting master into #1007 (for which that's important)?

@mstoykov
Copy link
Collaborator Author

mstoykov commented Sep 2, 2019

Hmmm .. I technically did directly in #1117 but I can cherry-pick it in a different PR and rebase it when this get merged ...
But first will have to figure what went wrong with the tests

cuonglm
cuonglm previously approved these changes Sep 3, 2019
@mstoykov mstoykov dismissed stale reviews from cuonglm and na-- via 3f54c7f September 3, 2019 07:25
imiric
imiric previously approved these changes Sep 3, 2019
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

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

Awesome!

@mstoykov
Copy link
Collaborator Author

mstoykov commented Sep 3, 2019

After a bunch more tries at fixing the panics and getting ... them rarer and rarer I am of the opinion that it's a lot better if I just remove the logs and assert/require's in the ws handlers.
And with that everything will be okay.

I don't think that the handlers themselves should check for this things I think that the test should be able to detect whether the handle did what they wanted and if this is not possible a custom handler and that is synchronized to exist before the test ends will need to be written.

@na-- , @imiric , @cuonglm what do you think ?

@codecov-io
Copy link

codecov-io commented Sep 3, 2019

Codecov Report

Merging #1138 into master will decrease coverage by 0.02%.
The diff coverage is 70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1138      +/-   ##
==========================================
- Coverage   73.58%   73.55%   -0.03%     
==========================================
  Files         144      144              
  Lines       10527    10527              
==========================================
- Hits         7746     7743       -3     
- Misses       2323     2326       +3     
  Partials      458      458
Impacted Files Coverage Δ
js/modules/k6/ws/ws.go 78.94% <100%> (-1.14%) ⬇️
lib/testutils/httpmultibin.go 93.93% <68.42%> (-1.55%) ⬇️
core/engine.go 93.92% <0%> (+0.93%) ⬆️

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 d385166...2c27c56. Read the comment docs.

@mstoykov mstoykov force-pushed the dontUseExternalSiteForTestingWebsockets branch from 3e4daa7 to 2c27c56 Compare September 4, 2019 05:18
@na-- na-- added this to the v0.26.0 milestone Sep 4, 2019
@mstoykov mstoykov merged commit 2f57278 into master Sep 4, 2019
@mstoykov mstoykov deleted the dontUseExternalSiteForTestingWebsockets branch September 4, 2019 11:50
imiric pushed a commit that referenced this pull request Sep 9, 2019
This _should_ fix flaky test `TestSentReceivedMetrics`.
See https://circleci.com/gh/loadimpact/k6/6474, https://circleci.com/gh/loadimpact/k6/6484 .

This issue was introduced in a63bb58 (PR #1138), where the previous
implementation of `getWebsocketEchoHandler()` closed the connection
after writing, so this change brings that back.

It seems that closing the connection creates additional metrics which
`TestSentReceivedMetrics` takes into account _sometimes_, hence the
flakiness.
imiric pushed a commit that referenced this pull request Sep 11, 2019
This _should_ fix flaky test `TestSentReceivedMetrics`.
See https://circleci.com/gh/loadimpact/k6/6474, https://circleci.com/gh/loadimpact/k6/6484 .

This issue was introduced in a63bb58 (PR #1138), where the previous
implementation of `getWebsocketEchoHandler()` closed the connection
after writing, so this change brings that back.

It seems that closing the connection creates additional metrics which
`TestSentReceivedMetrics` takes into account _sometimes_, hence the
flakiness.

From discussions with @na--, we agreed to remove the persistent
connection implementation of a63bb58 (the `for` loop here) since that
matches the previous version, but we'll create a new WS test that
tests multiple message passing, since none of our current tests seem
to do this.
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.

None yet

5 participants