arcade-mcp/libs/tests/arcade_mcp_server
Eric Gustin d7d765343e
Fix multiple worker log level bug (#758)
When running `arcade_mcp_server` with `workers > 1`, uvicorn spawns
worker subprocesses that directly call `create_arcade_mcp_factory()`
without going through `main()`. Since `setup_logging()` is only called
in `main()`, these subprocesses have no logging configuration, causing:

1. Standard Python logging not intercepted by Loguru
    
2. DEBUG-level logs from libraries like urllib3 appearing when OTEL is
enabled
    
3. Inconsistent log formats between main process and workers

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches process-wide logging initialization for uvicorn worker
subprocesses, which can affect log levels/handlers and output across the
server. Functional impact is limited to observability but could change
verbosity when OTEL or libraries emit logs.
> 
> **Overview**
> Fixes multi-worker/reload mode logging by configuring Loguru inside
`create_arcade_mcp_factory()` (using `ARCADE_MCP_DEBUG` to set `INFO` vs
`DEBUG`) so uvicorn-spawned worker subprocesses get the same
logging/interception as `main()`.
> 
> Adds regression tests that assert the factory filters DEBUG logs by
default and enables them when `ARCADE_MCP_DEBUG=true`, and bumps
`arcade-mcp-server` to `1.15.2`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0c262eb9716ecbd589f1524842243a7aed80666e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-01-30 15:37:52 -08:00
..
integration Four bug fixes (#754) 2026-01-29 15:12:06 -08:00
transports Adding MCP Servers supports to Arcade Evals (#689) 2026-01-07 20:26:23 -03:00
__init__.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
conftest.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_context.py Adding MCP Servers supports to Arcade Evals (#689) 2026-01-07 20:26:23 -03:00
test_convert.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_error_handling_middleware.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_logging_middleware.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_mcp_app.py Adding MCP Servers supports to Arcade Evals (#689) 2026-01-07 20:26:23 -03:00
test_middleware_base.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_openapi_docs.py Adding MCP Servers supports to Arcade Evals (#689) 2026-01-07 20:26:23 -03:00
test_prompt.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_public_imports.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_resource.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_resource_server_auth.py Support Ed25519 Algorithm (#742) 2026-01-16 15:55:05 -08:00
test_server.py Front-Door Auth (#696) 2025-12-11 12:51:20 -08:00
test_session.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_session_cancellation.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_settings.py Adding MCP Servers supports to Arcade Evals (#689) 2026-01-07 20:26:23 -03:00
test_tool.py MCP Local (#563) 2025-09-25 15:28:15 -07:00
test_worker_factory.py Fix multiple worker log level bug (#758) 2026-01-30 15:37:52 -08:00