Make legacy payment delivery retryable and keep gateway paths responsive
This commit is contained in:
@@ -78,6 +78,8 @@ class PublicTransparentTests(unittest.IsolatedAsyncioTestCase):
|
||||
'TIMEOUT': aiohttp.ClientTimeout(total=5), 'SKIP': ('/v1/',),
|
||||
'_GEN_PATHS': {'/v1/chat/completions', '/v1/messages', '/v1/responses'},
|
||||
'LOG': logging.getLogger('transparent_test'),
|
||||
'public_error': public_error, 'public_json_dumps': public_json_dumps,
|
||||
'secrets': secrets,
|
||||
'gate_check': AsyncMock(return_value=(False, '')), '_rl_check_sync': Mock(return_value=None),
|
||||
'_DEV_ROLE_INCOMPAT_PREFIXES': ("qwen", "glm", "deepseek", "kimi"),
|
||||
'_key_balance_usd': Mock(return_value=None),
|
||||
@@ -93,8 +95,11 @@ class PublicTransparentTests(unittest.IsolatedAsyncioTestCase):
|
||||
names = {'CONTROL_SESSION_KEY', 'GENERATION_CONNECTIONS', 'CONTROL_CONNECTIONS'}
|
||||
constants = [node for node in tree.body if isinstance(node, ast.Assign) and any(isinstance(target, ast.Name) and target.id in names for target in node.targets)]
|
||||
exec(compile(ast.Module(body=constants, type_ignores=[]), str(SKIN), 'exec'), self.ns)
|
||||
# real error wire form: proxy's failure paths must exercise the offloaded
|
||||
# mapping, not a stub, otherwise a reverted sync call would still pass.
|
||||
extract(SKIN, {'proxy', 'response_headers', '_dev_role_incompat_model',
|
||||
'_normalize_developer_roles', '_open_upstream_sessions', '_close_upstream_sessions'}, self.ns)
|
||||
'_normalize_developer_roles', '_open_upstream_sessions', '_close_upstream_sessions',
|
||||
'async_error_response', '_error_payload', '_finish_error'}, self.ns)
|
||||
self.app.router.add_route('*', '/{path:.*}', self.ns['proxy'])
|
||||
self.client = TestClient(TestServer(self.app))
|
||||
await self.client.start_server()
|
||||
@@ -246,7 +251,7 @@ class PublicErrorWireTests(unittest.IsolatedAsyncioTestCase):
|
||||
'public_error': public_error, 'public_json_dumps': public_json_dumps,
|
||||
'LOG': logging.getLogger('error_wire_test'),
|
||||
}
|
||||
extract(SKIN, {'error_response'}, namespace)
|
||||
extract(SKIN, {'error_response', '_error_payload', '_finish_error'}, namespace)
|
||||
|
||||
async def handler(request):
|
||||
return namespace['error_response'](
|
||||
|
||||
Reference in New Issue
Block a user