Skip to content

bug(slm-agent): get_redis_client deferred import in _publish_state_change breaks test patching #3422

@mrveiss

Description

@mrveiss

Discovered During

Code review of PR #3415.

Problem

In health_collector.py, get_redis_client is imported inside the _publish_state_change method body (deferred import). All four tests in TestPublishStateChange patch slm.agent.health_collector.get_redis_client — but since the name is never bound at module level, the patch raises AttributeError and the entire test class fails in CI.

Fix

Move from autobot_shared.redis_client import get_redis_client to module-level imports, or change the patch target to autobot_shared.redis_client.get_redis_client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions