| [gw0] darwin -- Python 3.12.12 /Users/cao/.pyenv/versions/3.12.12/bin/python3.12
|
| tests/test_earnings_lookup.py:467: in test_has_recent_earnings_returns_false_for_empty_records
|
| result = has_recent_earnings("UNKNOWN", days=7)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| has_recent_earnings = <function has_recent_earnings at 0x11f576ac0>
|
| mock_db_empty = (<MagicMock name='DBAccounting().__enter__()' id='4959529216'>, <MagicMock name='DBAccounting().__enter__().collection()' id='4959527152'>)
|
| self = <tests.test_earnings_lookup.TestHasRecentEarnings object at 0x124d9d550>
|
| rtrader/utils/earnings.py:480: in has_recent_earnings
|
| records = get_earnings(symbol, limit=4)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| cutoff = datetime.date(2026, 4, 11)
|
| days = 7
|
| symbol = 'UNKNOWN'
|
| today = datetime.date(2026, 4, 18)
|
| rtrader/utils/earnings.py:71: in get_earnings
|
| return _lookup_earnings(
|
| force_fmp = False
|
| limit = 4
|
| symbol = 'UNKNOWN'
|
| rtrader/utils/earnings.py:127: in _lookup_earnings
|
| _trigger_earnings_background_refresh(symbol)
|
| check_stale = True
|
| force_fmp = False
|
| is_symbol_etf_safe = <MagicMock name='is_symbol_etf_safe' id='4959612096'>
|
| limit = 4
|
| local_records = []
|
| needs_sync = True
|
| symbol = 'UNKNOWN'
|
| sync_to_db = True
|
| rtrader/utils/earnings.py:320: in _trigger_earnings_background_refresh
|
| if redis.set(lock_key, "1", nx=True, ex=300):
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| lock_key = 'earnings_refresh:pending:UNKNOWN'
|
| redis = <redis.client.Redis(<redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISC...protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>)>
|
| redis_testbox001 = <function redis_testbox001 at 0x10dfd32e0>
|
| symbol = 'UNKNOWN'
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/utils.py:417: in wrapper
|
| return func(*args, **kwargs)
|
| ^^^^^^^^^^^^^^^^^^^^^
|
| arg = 'ifdne'
|
| arg_names = ('self', 'name', 'value', 'ex', 'px', 'nx', ...)
|
| args = (<redis.client.Redis(<redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNIS...t_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>)>, 'earnings_refresh:pending:UNKNOWN', '1')
|
| args_to_warn = ['ifeq', 'ifne', 'ifdeq', 'ifdne']
|
| func = <function BasicKeyCommands.set at 0x110bd1800>
|
| kwargs = {'ex': 300, 'nx': True}
|
| provided_args = {'ex': 300, 'name': 'earnings_refresh:pending:UNKNOWN', 'nx': True, 'value': '1'}
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/commands/core.py:2518: in set
|
| return self.execute_command("SET", *pieces, **options)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ex = 300
|
| exat = None
|
| get = False
|
| ifdeq = None
|
| ifdne = None
|
| ifeq = None
|
| ifne = None
|
| keepttl = False
|
| name = 'earnings_refresh:pending:UNKNOWN'
|
| nx = True
|
| options = {}
|
| pieces = ['earnings_refresh:pending:UNKNOWN', '1', 'NX', 'EX', 300]
|
| px = None
|
| pxat = None
|
| self = <redis.client.Redis(<redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISC...protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>)>
|
| value = '1'
|
| xx = False
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/client.py:657: in execute_command
|
| return self._execute_command(*args, **options)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| args = ('SET', 'earnings_refresh:pending:UNKNOWN', '1', 'NX', 'EX', 300)
|
| options = {}
|
| self = <redis.client.Redis(<redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISC...protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>)>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/client.py:663: in _execute_command
|
| conn = self.connection or pool.get_connection()
|
| ^^^^^^^^^^^^^^^^^^^^^
|
| args = ('SET', 'earnings_refresh:pending:UNKNOWN', '1', 'NX', 'EX', 300)
|
| command_name = 'SET'
|
| options = {}
|
| pool = <redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISCW7,socket_timeout=No...e,protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>
|
| self = <redis.client.Redis(<redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISC...protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>)>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/utils.py:196: in wrapper
|
| return func(*args, **kwargs)
|
| ^^^^^^^^^^^^^^^^^^^^^
|
| allowed_args = []
|
| arg = '*'
|
| arg_names = ('self', 'command_name')
|
| args = (<redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISCW7,socket_timeout=N...protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>,)
|
| args_to_warn = ['*']
|
| func = <function ConnectionPool.get_connection at 0x110b27600>
|
| kwargs = {}
|
| provided_args = {}
|
| reason = 'Use get_connection() without args instead'
|
| version = '5.3.0'
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/connection.py:2603: in get_connection
|
| connection.connect()
|
| command_name = None
|
| connection = <redis.connection.Connection(host=testbox001,port=6379,db=0)>
|
| keys = ()
|
| options = {}
|
| self = <redis.connection.ConnectionPool(<redis.connection.Connection(db=0,username=None,password=YE3BNISCW7,socket_timeout=No...e,protocol=2,host=testbox001,port=6379,socket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/connection.py:846: in connect
|
| self.connect_check_health(check_health=True)
|
| self = <redis.connection.Connection(host=testbox001,port=6379,db=0)>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/connection.py:869: in connect_check_health
|
| self.on_connect_check_health(check_health=check_health)
|
| check_health = True
|
| retry_socket_connect = True
|
| self = <redis.connection.Connection(host=testbox001,port=6379,db=0)>
|
| sock = <socket.socket [closed] fd=-1, family=2, type=1, proto=6>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/connection.py:1007: in on_connect_check_health
|
| self.read_response()
|
| auth_args = ('YE3BNISCW7',)
|
| auth_response = b'OK'
|
| check_health = True
|
| cred_provider = <redis.credentials.UsernamePasswordCredentialProvider object at 0x1279b51c0>
|
| parser = <redis._parsers.resp2._RESP2Parser object at 0x1279b5250>
|
| self = <redis.connection.Connection(host=testbox001,port=6379,db=0)>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/connection.py:1133: in read_response
|
| response = self._parser.read_response(disable_decoding=disable_decoding)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| disable_decoding = False
|
| disconnect_on_error = True
|
| host_error = 'testbox001:6379'
|
| push_request = False
|
| self = <redis.connection.Connection(host=testbox001,port=6379,db=0)>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/_parsers/resp2.py:15: in read_response
|
| result = self._read_response(disable_decoding=disable_decoding)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| disable_decoding = False
|
| pos = 0
|
| self = <redis._parsers.resp2._RESP2Parser object at 0x1279b5250>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/_parsers/resp2.py:25: in _read_response
|
| raw = self._buffer.readline()
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
| disable_decoding = False
|
| self = <redis._parsers.resp2._RESP2Parser object at 0x1279b5250>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/_parsers/socket.py:115: in readline
|
| self._read_from_socket()
|
| buf = <_io.BytesIO object at 0x127930130>
|
| data = b''
|
| self = <redis._parsers.socket.SocketBuffer object at 0x1279b5100>
|
| ../.pyenv/versions/3.12.12/lib/python3.12/site-packages/redis/_parsers/socket.py:65: in _read_from_socket
|
| data = self._sock.recv(socket_read_size)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| E Failed: Timeout (>60.0s) from pytest-timeout.
|
| buf = <_io.BytesIO object at 0x127930130>
|
| current_pos = 0
|
| custom_timeout = False
|
| length = None
|
| marker = 0
|
| raise_on_timeout = True
|
| self = <redis._parsers.socket.SocketBuffer object at 0x1279b5100>
|
| sock = <socket.socket [closed] fd=-1, family=2, type=1, proto=6>
|
| socket_read_size = 65536
|
| timeout = <object object at 0x10d2d8e00>
|