Skip to content

Bug: redis_thread_safety_test references non-existent datetime attribute on redis_client module #2211

@mrveiss

Description

@mrveiss

Problem

In `autobot-backend/utils/redis_thread_safety_test.py` line 278-280:

```python
import autobot_shared.redis_client as redis_client_module
original_datetime = redis_client_module.datetime
```

`autobot_shared.redis_client` does NOT import `datetime` at module level, so `redis_client_module.datetime` raises `AttributeError` at runtime. This test has been broken since before the import migration (#2047) — the original `utils.redis_client` resolved to the same file.

Discovered During

Code review of PR #2171 (issue #2047)

Fix

Either:

  • Add `from datetime import datetime` to `autobot_shared/redis_client.py` (if the test legitimately needs to mock it), or
  • Fix the test to mock the correct module's datetime

Impact

Low — test is broken but likely not in the CI test suite (it's a manual test file).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions