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

Tests fail (with Protocol::WebSocket 0.22?) #33

Closed
eserte opened this issue Dec 10, 2017 · 9 comments
Closed

Tests fail (with Protocol::WebSocket 0.22?) #33

eserte opened this issue Dec 10, 2017 · 9 comments
Labels

Comments

@eserte
Copy link

eserte commented Dec 10, 2017

Tests started to fail on my smokers:

        # Failed test at t/anyevent_websocket_connection.t line 154.
        # Unicode::GCString is not installed, table may not display all unicode characters properly
        # +---------------------+---------------------+----+----------+----------+
        # | PATH                | GOT                 | OP | CHECK    | LNs      |
        # +---------------------+---------------------+----+----------+----------+
        # |                     | AnyEvent::WebSocket |    | <OBJECT> | 150, 153 |
        # |                     | ::Connection=HASH(0 |    |          |          |
        # |                     | x44ca5cf0)          |    |          |          |
        # |                     |                     |    |          |          |
        # | close_code()        | 963                 | eq | 1005     | 440      |
        # | close_reason()      | �bb                 | eq | bb       | 440      |
        # +---------------------+---------------------+----+----------+----------+
    # Failed test 'close'
    # at t/anyevent_websocket_connection.t line 155.

(etc)

Statistical analysis suggests that the problem started with Protocol::WebSocket 0.22 (@vti @leonerd: FYI):

****************************************************************
Regression 'mod:Protocol::WebSocket'
****************************************************************
Name           	       Theta	      StdErr	 T-stat
[0='const']    	      1.0000	      0.0000	63928868152459800.00
[1='eq_0.21']  	      0.0000	      0.0000	   2.74
[2='eq_0.22']  	     -1.0000	      0.0000	-40146423047850984.00

R^2= 1.000, N= 135, K= 3
****************************************************************
@plicease plicease added the bug label Dec 12, 2017
@vti
Copy link

vti commented Dec 12, 2017

Sorry, blame @leonerd for that :)

@leonerd
Copy link

leonerd commented Dec 12, 2017

Oops. This is almost certainly related to Unicode string vs. UTF-8 character handling in the surrounding code.

If someone can give me a bit of hand-holding about development/setup/testing on this code I'll be happy to take a look and see if I can fix it.

@leonerd
Copy link

leonerd commented Dec 12, 2017

Oh actually it's a ~2line patch to fix.

GH33.patch.txt

You may need to bump the version requirement of Protocol::WebSocket to the earliest one in which Protocol::WebSocket::Frame supports the opcode constructor argument - offhand I don't know which one that is. Maybe @vti can assist?

Clarification: It shouldn't need Protocol::WebSocket 0.22 itself here, as the change should be back-compat. The only issue was setting opcode before parsing the buffer, as it now needs to know if it's a text frame or not before it does that.

@plicease
Copy link
Member

Thanks for the speedy fix. We already require Protocol::WebSocket 0.20, is that sufficient?

@plicease
Copy link
Member

Patch seems to work with 0.20, 0.21, 0.22 and 0.23. Since the change was reverted in 0.23 it isn't necessary there (?), but it doesn't seem to do any harm either.

@vti
Copy link

vti commented Dec 12, 2017

It effected other modules that's why I reverted it for now.

@plicease
Copy link
Member

yeah. I gathered.

I've released this fix as WSC 0.44, as it fixes compat with PW 0.22 and doesn't seem to break any of the other versions that we support. Please let me know if there are any changes in WSC required for good fix referred to here: vti/protocol-websocket#54 (comment)

@vti
Copy link

vti commented Dec 12, 2017 via email

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

No branches or pull requests

4 participants