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 hang against twisted-16.3.0 #62

Closed
warner opened this issue Jul 7, 2016 · 15 comments
Closed

tests hang against twisted-16.3.0 #62

warner opened this issue Jul 7, 2016 · 15 comments

Comments

@warner
Copy link
Collaborator

warner commented Jul 7, 2016

Running 'tox' on wormhole trunk (currently at cdb5c19) hangs at test_scripts.Cleanup. Downgrading Twisted from current 16.3.0 to 16.2.0 lets it pass all tests.

@warner
Copy link
Collaborator Author

warner commented Jul 7, 2016

git bisect (awesome as ever) reveals that the problem started when Twisted landed twisted/twisted@1d69e04, to resolve Twisted#8320 "Remove pipelining from HTTPChannel". The ticket mentions something about it maybe breaking tests which might be using StringTransport.. sounds like we should investigate whether the wormhole tests were using those.

@warner
Copy link
Collaborator Author

warner commented Jul 7, 2016

@meejah hey, can you reproduce this? It doesn't seem to be affecting normal operation, but tests are messed up and I'm wondering if other Autobahn projects are seeing something similar (I don't see any autobahn tickets filed yet, so I'm wondering if our tests are doing something unusual).

So far it looks like the rendezvous server is receiving both websocket connections (onOpen) during the test, but it's not receiving any of the onMessage() that it's supposed to get. There are no exceptions in the logs, alas.

@meejah
Copy link
Member

meejah commented Jul 7, 2016

Is it Cleanup.test_text that hangs? If so, then "yes", I can repeat this with 16.3.0

Don't recall seeing this in Autobahn; will check there (we definitely use StringTransport for some tests). I do recall a lot of discussion on #twisted surrounding transports and HTTP (and HTTP/2) and I know Autobahn is one of the "less normal" cases that "does stuff" to the transport (e.g. so you can serve a WebSocket and a normal Web page from the same listener -- Autobahn gives you a help page if you HTTP GET to a WebSocket endpoint).

@meejah
Copy link
Member

meejah commented Jul 7, 2016

p.s. if you want debug logging from Autobahn, you can put a snippet like this in some test_*.py:

import txaio
txaio.start_logging(level='debug')

@meejah
Copy link
Member

meejah commented Jul 7, 2016

FWIW, I just confirmed that all Autobahn tests pass against 16.3.0 -- but, there isn't 100% coverage so could still be an Autobahn issue and not wormhole...

@oberstet
Copy link

oberstet commented Jul 7, 2016

@warner Are you using autobahn.twisted.resource.WebSocketResource (and hence running under Twisted Web)? My best guess: it will work when running WebSocket not under Twisted Web. It might be fallout from Twisted trying to support HTTP/2. For Autobahn, we plan to "reverse": crossbario/autobahn-python#641 (comment) : that is, parse the initial HTTP request ourselves, and only when the request isn't for an URL/Upgrade header to WebSocket, hand over to Twisted Web. That would shield us from the follies/fallout of HTTP/2 ..

@hawkowl
Copy link

hawkowl commented Jul 8, 2016

This has affected Daphne as well.

We changed everything to go through the channel (self.channel.transport) so I think it is a side effect of that. I'll check.

@warner
Copy link
Collaborator Author

warner commented Jul 8, 2016

Oh, yes, the wormhole server is using WebSocketResource. The test spin up a new server (under the tox-installed local Twisted), so that's probably why the tests are failing. I haven't updated the real server in a few weeks: it must still be using Twisted-16.2.0, which is why normal operation is still working (clients use a non-twisted.web websocket). I bet if I upgraded that, normal wormhole usage would fail too.

@hawkowl
Copy link

hawkowl commented Jul 8, 2016

I have come up with a reason -- the git commit you bisected added flow control to Request, meaning that the transport was paused (this is how we're handling pipelined requests now).

@hawkowl
Copy link

hawkowl commented Jul 8, 2016

Bug fix written, making a PR on Autobahn....

@hawkowl
Copy link

hawkowl commented Jul 8, 2016

Seems like @tomprince also fixed it :)

@meejah
Copy link
Member

meejah commented Jul 8, 2016

For bystanders reading this, you can install specifically Twisted 16.1.1 to work around this for now. That's pip uninstall twisted and then pip install twisted==16.1.1.

@meejah
Copy link
Member

meejah commented Jul 8, 2016

See also crossbario/autobahn-python#641

@oberstet
Copy link

@warner @hawkowl 's patch is on Autobahn master - so it should work with latest Twisted for you again ..

@warner
Copy link
Collaborator Author

warner commented Dec 8, 2016

I think there's been a new Autobahn release since this problem, and it's not happening on an updated tox just now, so it's probably safe to close this now.

@warner warner closed this as completed Dec 8, 2016
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

No branches or pull requests

4 participants