| [gw4] darwin -- Python 3.12.12 /Users/cao/.pyenv/versions/3.12.12/bin/python3.12
|
| tests/test_earnings_lookup.py:154: in test_get_earnings_normalizes_symbol_to_uppercase
|
| get_earnings("aapl", limit=4)
|
| get_earnings = <function get_earnings at 0x123451ee0>
|
| mock_collection = <MagicMock name='DBAccounting().__enter__().collection()' id='5023707648'>
|
| mock_db = <MagicMock name='DBAccounting().__enter__()' id='5023705776'>
|
| mock_db_with_earnings = (<MagicMock name='DBAccounting().__enter__()' id='5023705776'>, <MagicMock name='DBAccounting().__enter__().collection()' id='5023707648'>)
|
| self = <tests.test_earnings_lookup.TestGetEarnings object at 0x128cae8d0>
|
| rtrader/utils/earnings.py:71: in get_earnings
|
| return _lookup_earnings(
|
| force_fmp = False
|
| limit = 4
|
| symbol = 'aapl'
|
| 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='5022717888'>
|
| limit = 4
|
| local_records = [{'date': '2026-04-26', 'eps': None, 'epsEstimated': 2.65, 'eps_estimated': 2.65, ...}, {'date': '2026-01-29', 'eps': ....63, 'eps_estimated': 1.63, ...}, {'date': '2025-01-30', 'eps': 2.4, 'epsEstimated': 2.36, 'eps_estimated': 2.36, ...}]
|
| needs_sync = True
|
| symbol = 'AAPL'
|
| 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:AAPL'
|
| 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 0x111f572e0>
|
| symbol = 'AAPL'
|
| ../.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...cket_connect_timeout=5,socket_keepalive=True,socket_keepalive_options=None)>)>)>, 'earnings_refresh:pending:AAPL', '1')
|
| args_to_warn = ['ifeq', 'ifne', 'ifdeq', 'ifdne']
|
| func = <function BasicKeyCommands.set at 0x114aa5800>
|
| kwargs = {'ex': 300, 'nx': True}
|
| provided_args = {'ex': 300, 'name': 'earnings_refresh:pending:AAPL', '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:AAPL'
|
| nx = True
|
| options = {}
|
| pieces = ['earnings_refresh:pending:AAPL', '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:AAPL', '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:AAPL', '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 0x11207b600>
|
| 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:941: in on_connect_check_health
|
| auth_response = self.read_response()
|
| ^^^^^^^^^^^^^^^^^^^^
|
| auth_args = ('YE3BNISCW7',)
|
| check_health = True
|
| cred_provider = <redis.credentials.UsernamePasswordCredentialProvider object at 0x12b704770>
|
| parser = <redis._parsers.resp2._RESP2Parser object at 0x12b5f4050>
|
| 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 0x12b5f4050>
|
| ../.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 0x12b5f4050>
|
| ../.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 0x12b82f150>
|
| data = b''
|
| self = <redis._parsers.socket.SocketBuffer object at 0x12b704710>
|
| ../.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 0x12b82f150>
|
| current_pos = 0
|
| custom_timeout = False
|
| length = None
|
| marker = 0
|
| raise_on_timeout = True
|
| self = <redis._parsers.socket.SocketBuffer object at 0x12b704710>
|
| sock = <socket.socket [closed] fd=-1, family=2, type=1, proto=6>
|
| socket_read_size = 65536
|
| timeout = <object object at 0x11125ce00>
|