[loop-generated] [optimization] Slow test: test_create_timmy_default_includes_mcp_tools takes 2.5s #159

Closed
opened 2026-03-15 15:08:44 +00:00 by hermes · 1 comment
Collaborator

Slowest unit test: tests/timmy/test_agent.py::test_create_timmy_default_includes_mcp_tools at 2.5s.

This test creates a Timmy agent with MCP tools. Likely bottleneck: MCP initialization, subprocess spawning, or heavy fixture setup.

Target: under 500ms. Profile and optimize — mock heavy I/O, lazy-load MCP, or restructure fixtures.

Also slow:

  • test_run_exhausts_retries (2.0s) — uses real sleep in retry loops
  • test_run_retries_on_transient_error (2.0s) — same
  • test_grok_chat_without_key (1.5s) — likely network timeout

These are unit tests. They should not have real I/O waits.

Slowest unit test: `tests/timmy/test_agent.py::test_create_timmy_default_includes_mcp_tools` at 2.5s. This test creates a Timmy agent with MCP tools. Likely bottleneck: MCP initialization, subprocess spawning, or heavy fixture setup. Target: under 500ms. Profile and optimize — mock heavy I/O, lazy-load MCP, or restructure fixtures. Also slow: - test_run_exhausts_retries (2.0s) — uses real sleep in retry loops - test_run_retries_on_transient_error (2.0s) — same - test_grok_chat_without_key (1.5s) — likely network timeout These are unit tests. They should not have real I/O waits.
Author
Collaborator

Triage Update — Current Slow Test Data (2026-03-15)

The issue title references test_create_timmy_default_includes_mcp_tools at 2.5s, but current profiling shows different bottlenecks:

31.84s  tests/timmy/test_introspection.py::TestRunSelfTests::test_returns_dict_with_expected_keys
12.79s  tests/e2e/test_ollama_integration.py::test_timmy_agent_with_available_model (e2e, expected)
 4.11s  tests/timmy/test_agent.py::test_create_timmy_includes_tools_for_large_model
 2.00s  tests/timmy/test_agent_retry.py::test_run_exhausts_retries (real sleep)
 2.00s  tests/timmy/test_agent_retry.py::test_run_retries_on_transient_error (real sleep)

The 31.8s introspection test now has its own issue. This issue should focus on:

  1. The retry tests using real time.sleep() — mock the sleep
  2. The 4.1s agent test — profile and optimize fixture setup

Updated target: all unit tests under 1s each (excluding e2e).

[triage-generated]

## Triage Update — Current Slow Test Data (2026-03-15) The issue title references `test_create_timmy_default_includes_mcp_tools` at 2.5s, but current profiling shows different bottlenecks: ``` 31.84s tests/timmy/test_introspection.py::TestRunSelfTests::test_returns_dict_with_expected_keys 12.79s tests/e2e/test_ollama_integration.py::test_timmy_agent_with_available_model (e2e, expected) 4.11s tests/timmy/test_agent.py::test_create_timmy_includes_tools_for_large_model 2.00s tests/timmy/test_agent_retry.py::test_run_exhausts_retries (real sleep) 2.00s tests/timmy/test_agent_retry.py::test_run_retries_on_transient_error (real sleep) ``` The 31.8s introspection test now has its own issue. This issue should focus on: 1. The retry tests using real `time.sleep()` — mock the sleep 2. The 4.1s agent test — profile and optimize fixture setup Updated target: all unit tests under 1s each (excluding e2e). [triage-generated]
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#159