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

fix(ws): return error before running setup fn if WS is not connectable #1127

Merged
merged 1 commit into from
Aug 29, 2019

Conversation

imiric
Copy link
Contributor

@imiric imiric commented Aug 27, 2019

This is a very naive fix for #1116: it ensures the WS connection is established before running the setup function.

This avoids the panic and running the test script provided by @mstoykov now outputs:

ERRO[0011] GoError: lookup nonexistant on 172.16.1.1:53: no such host
        at native
        at file:///home/ivan/.local/go/src/github.com/loadimpact/k6/test-ws.js:5:61(14)

Closes #1116

@imiric imiric requested review from mstoykov, na-- and cuonglm August 27, 2019 15:32
@codecov-io
Copy link

codecov-io commented Aug 27, 2019

Codecov Report

Merging #1127 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1127      +/-   ##
==========================================
+ Coverage   73.33%   73.35%   +0.01%     
==========================================
  Files         141      141              
  Lines       10305    10305              
==========================================
+ Hits         7557     7559       +2     
+ Misses       2304     2303       -1     
+ Partials      444      443       -1
Impacted Files Coverage Δ
js/modules/k6/ws/ws.go 80.08% <100%> (+0.81%) ⬆️

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 458316a...20d1d5a. Read the comment docs.

cuonglm
cuonglm previously approved these changes Aug 27, 2019
mstoykov
mstoykov previously approved these changes Aug 28, 2019
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM

na--
na-- previously approved these changes Aug 28, 2019
@na-- na-- added this to the v0.26.0 milestone Aug 29, 2019
@imiric imiric dismissed stale reviews from na--, mstoykov, and cuonglm via 9059dbc August 29, 2019 07:47
@imiric imiric force-pushed the fix/1116-ws-message-send-panic branch from 438720f to 9059dbc Compare August 29, 2019 07:47
@imiric imiric force-pushed the fix/1116-ws-message-send-panic branch from 9059dbc to 20d1d5a Compare August 29, 2019 08:08
@imiric imiric merged commit f2dff90 into master Aug 29, 2019
@imiric imiric deleted the fix/1116-ws-message-send-panic branch August 29, 2019 08:27
mstoykov added a commit that referenced this pull request Jan 10, 2022
There are no handlers to be made in that case.

Arguably prior to PR #1127 that could've been possible but not anymore,
so it's just a noop either way
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.

Panic in websocket handling
5 participants