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

Test failure when upgrading from 4.3.1 to 4.4.0 #385

Closed
matthewwillian opened this issue Nov 25, 2019 · 7 comments · Fixed by RC-MODULE/rumboot-tools#12
Closed

Test failure when upgrading from 4.3.1 to 4.4.0 #385

matthewwillian opened this issue Nov 25, 2019 · 7 comments · Fixed by RC-MODULE/rumboot-tools#12
Assignees
Labels

Comments

@matthewwillian
Copy link

matthewwillian commented Nov 25, 2019

Coming from usage of Flask-SocketIO.

from api.sockets import socket_io

def test_socketio(app, app_test_client):
    """Test that SocketIO connects."""
    socketio_test_client = socket_io.test_client(
        app, flask_test_client=app_test_client
    )
    assert not socketio_test_client.is_connected()

the namespace is defined as follows:

from flask_socketio import Namespace, SocketIO

from api.context import get_user

socket_io = SocketIO()  # SocketIO server - initialized within app init


class RootNamespace(Namespace):

    def on_connect(self):
        """Event handler for connecting to a namespace."""
        return get_user() is not None


socket_io.on_namespace(RootNamespace("/"))

this unit test fails against 4.4.0 but passes against 4.3.1. did the behavior of on_connect get indirectly changed by this version bump?

@miguelgrinberg
Copy link
Owner

Yeah, I'll have to look into this one, it is a side effect of the addition of the connect_error event.

@miguelgrinberg
Copy link
Owner

@matthewwillian Could you give the master branch of Flask-SocketIO a try and report back if the issue is corrected?

@viggyfresh
Copy link

hey @miguelgrinberg just following up on this - the test still fails with release 4.6.0!

@miguelgrinberg
Copy link
Owner

@viggyfresh there is a unit test in this repository that checks is_connected() and the test is passing. So I suspect whatever the issue is on your side it is different.

@viggyfresh
Copy link

@miguelgrinberg sorry for the delay here - I think I tracked down the issue!

We've bumped python-socketio up to 4.5.1, but I noticed in the commit that closes this issue (miguelgrinberg/Flask-SocketIO@a05ff51) that the fix was actually in the Flask-SocketIO package, which is still on version 4.2.1 (released August 2019, while the fix commit landed in November).

Any chance you'd be able to cut a release of Flask-SocketIO? Thanks a bunch - and no rush!

@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Apr 20, 2020

@viggyfresh oh, I see, sorry about that, that release fell through the cracks. Just released 4.3.0 with that fix.

@viggyfresh
Copy link

thanks @miguelgrinberg - resolved on our end!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants