crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.47k stars 763 forks source link

"RuntimeError: Event loop is closed" when running tests with pytest-asyncio 0.23.5.post1 #1631

Closed penguinpee closed 2 months ago

penguinpee commented 3 months ago

We intend to update pytest-asyncio in Fedora to version 0.23.5.post1. Testing dependent packages showed failing tests in autobahn in wamp and websocket:

Test errors ```python =================================== FAILURES =================================== _________________________ TestSigVectors.test_vectors __________________________ self = def test_vectors(self): session = Mock() for testvec in test_vectors_1: # setup fake transport details including fake channel_id if testvec['channel_id']: channel_id = binascii.a2b_hex(testvec['channel_id']) channel_id_type = 'tls-unique' session._transport.transport_details = types.TransportDetails(channel_id={'tls-unique': channel_id}) else: channel_id = None channel_id_type = None session._transport.transport_details = types.TransportDetails(channel_id=None) # private signing key (the seed for it) private_key = CryptosignKey.from_bytes(binascii.a2b_hex(testvec['private_key'])) # the fake challenge we've received challenge = types.Challenge("cryptosign", dict(challenge=testvec['challenge'])) # ok, now sign the challenge > f_signed = private_key.sign_challenge(challenge, channel_id=channel_id, channel_id_type=channel_id_type) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_cryptosign.py:132: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/cryptosign.py:521: in sign_challenge return _sign_challenge(data, self.sign) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/cryptosign.py:436: in _sign_challenge txaio.add_callbacks(d1, process, None) /usr/lib/python3.12/site-packages/txaio/aio.py:493: in add_callbacks return future.add_done_callback(done) /usr/lib64/python3.12/asyncio/base_events.py:793: in call_soon self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _________________________ TestAuth.test_authenticator __________________________ self = def test_authenticator(self): authenticator = create_authenticator( "cryptosign", authid="someone", authextra={'channel_binding': 'tls-unique'}, privkey=self.privkey_hex, ) session = Mock() session._transport.transport_details = self.transport_details challenge = types.Challenge("cryptosign", dict(challenge="ff" * 32)) > f_reply = authenticator.on_challenge(session, challenge) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_cryptosign.py:210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/auth.py:200: in on_challenge return self._privkey.sign_challenge(challenge, ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/cryptosign.py:521: in sign_challenge return _sign_challenge(data, self.sign) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/cryptosign.py:436: in _sign_challenge txaio.add_callbacks(d1, process, None) /usr/lib/python3.12/site-packages/txaio/aio.py:493: in add_callbacks return future.add_done_callback(done) /usr/lib64/python3.12/asyncio/base_events.py:793: in call_soon self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _____________________________ TestAuth.test_valid ______________________________ self = def test_valid(self): session = Mock() session._transport.transport_details = self.transport_details challenge = types.Challenge("cryptosign", dict(challenge="ff" * 32)) > f_signed = self.key.sign_challenge(challenge, channel_id=self.transport_details.channel_id['tls-unique'], channel_id_type='tls-unique') ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_cryptosign.py:181: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/cryptosign.py:521: in sign_challenge return _sign_challenge(data, self.sign) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/cryptosign.py:436: in _sign_challenge txaio.add_callbacks(d1, process, None) /usr/lib/python3.12/site-packages/txaio/aio.py:493: in add_callbacks return future.add_done_callback(done) /usr/lib64/python3.12/asyncio/base_events.py:793: in call_soon self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _________________ WebSocketClientProtocolTests.test_auto_ping __________________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847504.172068228, real_time = 847509000 call = diff = 4.8279317719861865 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847509000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketClientFactory() f.log = txaio.make_logger() p = WebSocketClientProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t p._transport_details = TransportDetails() > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:3473: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _________________ WebSocketServerProtocolTests.test_auto_ping __________________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847504.325946043, real_time = 847509000 call = diff = 4.674053956987336 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847509000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _____ WebSocketServerProtocolTests.test_interpolate_server_status_template _____ self = , delay = 5 func = > args = (), kwargs = {}, now = 847504.471455922, real_time = 847509000 call = diff = 4.5285440779989585 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847509000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError ________ WebSocketServerProtocolTests.test_sendClose_invalid_code_type _________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847504.617766727, real_time = 847509000 call = diff = 4.382233273005113 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847509000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError ________ WebSocketServerProtocolTests.test_sendClose_invalid_code_value ________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847504.764923327, real_time = 847509000 call = diff = 4.2350766729796305 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847509000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _______________ WebSocketServerProtocolTests.test_sendClose_none _______________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847504.916905145, real_time = 847509000 call = diff = 4.0830948549555615 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847509000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _______ WebSocketServerProtocolTests.test_sendClose_reason_with_no_code ________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847505.07139691, real_time = 847510000 call = diff = 4.928603089996614 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847510000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError ____________ WebSocketServerProtocolTests.test_sendClose_str_reason ____________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847505.218308785, real_time = 847510000 call = diff = 4.781691215001047 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847510000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError _____________ WebSocketServerProtocolTests.test_sendClose_toolong ______________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847505.370747717, real_time = 847510000 call = diff = 4.629252283019014 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847510000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError __________ WebSocketServerProtocolTests.test_sendClose_unicode_reason __________ self = , delay = 5 func = > args = (), kwargs = {}, now = 847505.517936312, real_time = 847510000 call = diff = 4.482063687988557 def call_later(self, delay, func, *args, **kwargs): """ IBatchedTimer API """ # "quantize" the delay to the nearest bucket now = self._get_seconds() real_time = int(now + delay) * 1000 real_time -= int(real_time % self._bucket_milliseconds) call = _BatchedCall(self, real_time, lambda: func(*args, **kwargs)) try: > self._buckets[real_time][1].append(call) E KeyError: 847510000 /usr/lib/python3.12/site-packages/txaio/_common.py:88: KeyError During handling of the above exception, another exception occurred: self = def setUp(self): t = FakeTransport() f = WebSocketServerFactory() f.log = txaio.make_logger() p = WebSocketServerProtocol() p.log = txaio.make_logger() p.factory = f p.transport = t > p._connectionMade() ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/test/test_websocket_protocol.py:121: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:2574: in _connectionMade WebSocketProtocol._connectionMade(self) ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/websocket/protocol.py:1110: in _connectionMade self.openHandshakeTimeoutCall = self.factory._batched_timer.call_later( /usr/lib/python3.12/site-packages/txaio/_common.py:95: in call_later delayed_call = self._create_delayed_call( /usr/lib/python3.12/site-packages/txaio/aio.py:420: in call_later return self._loop.call_later(delay, real_call) /usr/lib64/python3.12/asyncio/base_events.py:759: in call_later timer = self.call_at(self.time() + delay, callback, *args, /usr/lib64/python3.12/asyncio/base_events.py:772: in call_at self._check_closed() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=True debug=False> def _check_closed(self): if self._closed: > raise RuntimeError('Event loop is closed') E RuntimeError: Event loop is closed /usr/lib64/python3.12/asyncio/base_events.py:540: RuntimeError =============================== warnings summary =============================== wamp/test/test_wamp_component_aio.py::test_asyncio_component ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_component_aio.py:36: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove the asyncio mark. If the test is not marked explicitly, check for global marks applied via 'pytestmark'. @pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+") wamp/test/test_wamp_component_aio.py::test_asyncio_component_404 ../../BUILDROOT/python-autobahn-23.6.2-3.fc39.x86_64/usr/lib/python3.12/site-packages/autobahn/wamp/test/test_wamp_component_aio.py:77: PytestWarning: The test is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove the asyncio mark. If the test is not marked explicitly, check for global marks applied via 'pytestmark'. @pytest.mark.skipif(sys.version_info < (3, 5), reason="requires Python 3.5+") -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED wamp/test/test_wamp_cryptosign.py::TestSigVectors::test_vectors - Runt... FAILED wamp/test/test_wamp_cryptosign.py::TestAuth::test_authenticator - Runt... FAILED wamp/test/test_wamp_cryptosign.py::TestAuth::test_valid - RuntimeError... FAILED websocket/test/test_websocket_protocol.py::WebSocketClientProtocolTests::test_auto_ping FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_auto_ping FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_interpolate_server_status_template FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_invalid_code_type FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_invalid_code_value FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_none FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_reason_with_no_code FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_str_reason FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_toolong FAILED websocket/test/test_websocket_protocol.py::WebSocketServerProtocolTests::test_sendClose_unicode_reason ==== 13 failed, 195 passed, 64 skipped, 13 deselected, 2 warnings in 6.58s ===== ```

Switching autobahn to use twisted for the time being wasn't as straight forward as I had hoped, either.

Cc: @Jenselme (Fedora package maintainer)

danigm commented 2 months ago

I think that this PR fixes this issue: https://github.com/crossbario/autobahn-python/pull/1634

oberstet commented 2 months ago

yes, this is released on https://github.com/crossbario/autobahn-python/tree/v23.6.2

dimbleby commented 2 months ago

yes, this is released on https://github.com/crossbario/autobahn-python/tree/v23.6.2

it is not. v23.6.2 dates from June 2023.

oberstet commented 2 months ago

here you are https://github.com/crossbario/autobahn-python/tree/v24.4.2

dimbleby commented 2 months ago

will there be a corresponding pypi release?

penguinpee commented 2 months ago

For what it's worth, I applied the fix as a patch on top of 23.6.2 and it fixes the issue reported. At least we know it's working. :wink:

oberstet commented 2 months ago

yes, I will push a release soonish. I tried actually at the time when I tagged the release - exactly like we always did. But even though I have 2FA on my PyPI, I ran into issues .. they changed sth. Anyways, I will look to get it done as soon as I find time.

meejah commented 2 months ago

Here's my latest knowledge on that, stated as a Makefile: https://github.com/meejah/fowl/blob/main/Makefile#L32

(You have to create a "token" now, ideally scoped to just the one thing)

image

oberstet commented 2 months ago

I tried with ${HOME}/.pypirc

[distutils]
index-servers =
  pypi
  pypitest

[pypi]
username = __token__
password = pypi-AgEIcH...

[pypitest]
username = __token__
password = pypi-AgEIcH...

but it fails (auth error) ... will recheck tomorrow

oberstet commented 2 months ago

this was trying "manual release publishing".

yet another issue is making "automatic release publishing" (pypa/gh-action-pypi-publish@release/v1)

https://github.com/crossbario/autobahn-python/blob/master/.github/workflows/deploy.yml

work again.

oberstet commented 2 months ago

cool logo btw! =)

grafik