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(browser): don't add already active socket again on reconnect #1248

Merged
merged 1 commit into from
Nov 25, 2014
Merged

Conversation

j0tunn
Copy link
Contributor

@j0tunn j0tunn commented Nov 19, 2014

Sometimes one socket can send few register messages, and every time this socket is being added to browser's active sockets as new. And on disconnect we get crash with error message like "TypeError: Cannot read property '1234567' of null".

In logs I can see messages like:

DEBUG [karma]: A browser has connected on socket __5YycZnaOXfrHk8kQFP
INFO [IE 8.0.0 (Windows 7)]: Connected on socket __5YycZnaOXfrHk8kQFP with id 35636946
DEBUG [launcher]: internet explorer via Remote WebDriver (id 35636946) captured in 3.71 secs
DEBUG [IE 8.0.0 (Windows 7)]: New connection __5YycZnaOXfrHk8kQFP (already have __5YycZnaOXfrHk8kQFP)
DEBUG [IE 8.0.0 (Windows 7)]: New connection __5YycZnaOXfrHk8kQFP (already have __5YycZnaOXfrHk8kQFP, __5YycZnaOXfrHk8kQFP)

This is the cause of problem described here: karma-runner/karma-junit-reporter#21

@j0tunn
Copy link
Contributor Author

j0tunn commented Nov 19, 2014

@vojtajina Take a look please

@maksimr
Copy link
Contributor

maksimr commented Nov 19, 2014

@j0tunn Thanks!

Add a test for this behavior.

@j0tunn
Copy link
Contributor Author

j0tunn commented Nov 20, 2014

@maksimr Done

Current behaviour: few 'register' messages from the same socket will lead to crash on disconnect
After fix: next 'register' messages from the same socket will be skipped
@j0tunn
Copy link
Contributor Author

j0tunn commented Nov 24, 2014

@maksimr ping

@maksimr
Copy link
Contributor

maksimr commented Nov 24, 2014

#merge

@karmarunnerbot
Copy link
Member

Sent to presubmit as presubmit-canary-pr-1248 Presubmit branch - Travis status

maksimr added a commit that referenced this pull request Nov 25, 2014
fix(browser): don't add already active socket again on reconnect
@maksimr maksimr merged commit 70108c9 into karma-runner:master Nov 25, 2014
@j0tunn
Copy link
Contributor Author

j0tunn commented Nov 25, 2014

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