Home / Function/ test_shutdown_command_timeout_logged() — langchain Function Reference

test_shutdown_command_timeout_logged() — langchain Function Reference

Architecture documentation for the test_shutdown_command_timeout_logged() function in test_shell_tool.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e494971b_b3f1_61b5_2fc1_66ff2d44d4e6["test_shutdown_command_timeout_logged()"]
  f21fd460_1d0c_cb92_cfa1_eae0890e2f58["test_shell_tool.py"]
  e494971b_b3f1_61b5_2fc1_66ff2d44d4e6 -->|defined in| f21fd460_1d0c_cb92_cfa1_eae0890e2f58
  1bc202d6_8b54_02e9_fadd_ff3171c38a75["_empty_state()"]
  e494971b_b3f1_61b5_2fc1_66ff2d44d4e6 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75
  style e494971b_b3f1_61b5_2fc1_66ff2d44d4e6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py lines 356–372

def test_shutdown_command_timeout_logged(tmp_path: Path) -> None:
    """Test that shutdown command timeouts are logged but don't raise."""
    policy = HostExecutionPolicy(command_timeout=0.1)
    middleware = ShellToolMiddleware(
        workspace_root=tmp_path / "workspace",
        execution_policy=policy,
        shutdown_commands=("sleep 2",),
    )
    runtime = Runtime()
    state = _empty_state()
    try:
        updates = middleware.before_agent(state, runtime)
        if updates:
            state.update(cast("ShellToolState", updates))
    finally:
        # Should not raise despite shutdown command timing out
        middleware.after_agent(state, runtime)

Domain

Subdomains

Frequently Asked Questions

What does test_shutdown_command_timeout_logged() do?
test_shutdown_command_timeout_logged() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py.
Where is test_shutdown_command_timeout_logged() defined?
test_shutdown_command_timeout_logged() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py at line 356.
What does test_shutdown_command_timeout_logged() call?
test_shutdown_command_timeout_logged() calls 1 function(s): _empty_state.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free