Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

VCR tests are unstable - socket is None in tornado.iostream #416

Open
yurishkuro opened this issue Jul 7, 2016 · 2 comments
Open

VCR tests are unstable - socket is None in tornado.iostream #416

yurishkuro opened this issue Jul 7, 2016 · 2 comments

Comments

@yurishkuro
Copy link
Contributor

A number of different tests related to VCR are randomly breaking CI, for example

https://travis-ci.org/uber/tchannel-python/jobs/143115312

_____________ ERROR at teardown of test_unexpected_error[hostPort] _____________
cassette = <InstanceDouble of <class 'tchannel.testing.vcr.cassette.Cassette'> object at 0x2b3e61913290>
unpatch = <function reset at 0x2b3e61987d70>
    @pytest.yield_fixture
    def vcr_service(cassette, unpatch):
        with VCRProxyService(cassette, unpatch) as vcr_service:
>           yield vcr_service

tests/testing/vcr/test_server.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tchannel/testing/vcr/server.py:219: in __exit__
    self.stop()
tchannel/testing/vcr/server.py:205: in stop
    self.tchannel._dep_tchannel.close()
tchannel/tornado/tchannel.py:236: in close
    self.peers.clear()
tchannel/tornado/peer.py:581: in clear
    peer.close()
tchannel/tornado/peer.py:246: in close
    connection.close()
tchannel/tornado/connection.py:313: in close
    self.connection.close()
.tox/py27-tornado43/lib/python2.7/site-packages/tornado/iostream.py:436: in close
    self.close_fd()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <tornado.iostream.IOStream object at 0x2b3e619112d0>
    def close_fd(self):
>       self.socket.close()
E       AttributeError: 'NoneType' object has no attribute 'close'
@yurishkuro yurishkuro changed the title VCR tests are unstable - socket is None no tornado.iostream VCR tests are unstable - socket is None in tornado.iostream Jul 7, 2016
@HelloGrayson
Copy link
Contributor

@yurishkuro did #417 solve this? I can close if so.

@yurishkuro
Copy link
Contributor Author

#417 masked the problem so that the tests don't fail spontaneously. Considering that the issue kept occurring in vcr tests, which according to @abhinav start a new thread, there is probably a race condition somewhere there, rather than a fundamental problem in Tornado.

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

No branches or pull requests

2 participants