diff --git a/autopush/tests/test_integration.py b/autopush/tests/test_integration.py index 8abe9a0d..87d1f78a 100644 --- a/autopush/tests/test_integration.py +++ b/autopush/tests/test_integration.py @@ -1905,14 +1905,14 @@ def _add_router(self): # The problem with calling the live system (even sandboxed) is that # you need a valid credential set from a mobile device, which can be # subject to change. - self._mock_send = Mock() - self._mock_reply = dict( + reply = dict( canonical_ids=0, failure=0, results=[{}], ) - self._mock_send.return_value = self._mock_reply + self._mock_send = Mock() fcm.fcm.send_request = self._mock_send + fcm.fcm.parse_responses = Mock(return_value=[reply]) @inlineCallbacks def test_registration(self): diff --git a/autopush/websocket.py b/autopush/websocket.py index 13f317d7..b49cf2a8 100644 --- a/autopush/websocket.py +++ b/autopush/websocket.py @@ -499,7 +499,13 @@ def onConnect(self, request): # Setup ourself to handle producing the data self.transport.bufferSize = 2 * 1024 - self.transport.registerProducer(self.ps, True) + try: + self.transport.registerProducer(self.ps, True) + except RuntimeError: + # HACK: Autobahn/twisted/h2 hacks mess this up, ensure we can + # register the producer + self.transport.unregisterProducer() + self.transport.registerProducer(self.ps, True) if self.ap_settings.hello_timeout > 0: self.setTimeout(self.ap_settings.hello_timeout) diff --git a/requirements.txt b/requirements.txt index 21c9200d..7fac746f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,44 +1,44 @@ -ConfigArgParse==0.10.0 -Twisted==16.4.0 +ConfigArgParse==0.12.0 +Twisted==17.1.0 apns==2.0.1 -attrs==16.1.0 -autobahn[twisted]==0.16.0 -boto==2.42.0 -boto3==1.4.0 -botocore==1.4.50 +attrs==17.1.0 +autobahn[twisted]==17.5.1 +boto==2.46.1 +boto3==1.4.4 +botocore==1.5.53 cffi==1.10.0 -click==6.6 -contextlib2==0.5.4 +click==6.7 +contextlib2==0.5.5 cryptography==1.8.1 cyclone==1.1 -datadog==0.13.0 -decorator==4.0.10 +datadog==0.16.0 +decorator==4.0.11 enum34==1.1.6 -future==0.15.2 -futures==3.0.5 +future==0.16.0 +futures==3.1.1 gcm-client==0.1.4 hyper==0.7.0 idna==2.5 ipaddress==1.0.18 -jmespath==0.9.0 -marshmallow==2.10.2 +jmespath==0.9.2 +marshmallow==2.13.5 marshmallow_polyfield==3.1 objgraph==3.1.0 -pyOpenSSL==16.1.0 -pyasn1==0.1.9 +pyOpenSSL==17.0.0 +pyasn1==0.2.3 pyasn1-modules==0.0.8 pycparser==2.17 pycrypto==2.6.1 -pyfcm==1.0.4 -python-dateutil==2.5.3 -raven==5.25.0 -requests==2.13.0 +pyfcm==1.2.9 +python-dateutil==2.6.0 +raven==6.0.0 +requests==2.14.2 service-identity==16.0.0 -simplejson==3.8.2 +simplejson==3.10.0 six==1.10.0 -typing==3.5.2.2 +typing==3.6.1 -e git+https://github.com/habnabit/txstatsd.git@157ef85fbdeafe23865c7c4e176237ffcb3c3f1f#egg=txStatsD-master -txaio==2.5.1 -ua_parser==0.7.1 -zope.interface==4.3.1 +txaio==2.7.1 +ua_parser==0.7.3 +zope.interface==4.4.1 wsaccel==0.6.2 ; platform_python_implementation == 'CPython' diff --git a/test-requirements.txt b/test-requirements.txt index 924ec702..beb28876 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,7 @@ funcsigs==1.0.2 pbr==1.10.0 -e git+https://github.com/habnabit/txstatsd.git@master#egg=txStatsD -e git+https://github.com/bbangert/moto.git@3bdb75a961148ea5aa526f0e88d9e7835a30df3a#egg=moto -flake8==3.2.0 +flake8==3.3.0 psutil websocket-client -Pympler==0.4.3 +Pympler==0.5