Skip to content

Default pytest can fail when ambient pytest-randomly reseeds numpy #67

Description

@ApolloZhangOnGithub

Summary

During Codex-engine smoke work on 2026-05-10, multiple targeted test runs failed before project assertions executed because an ambient pytest-randomly install reseeded numpy with an out-of-range value.

Evidence

Observed commands that failed under the default pytest plugin set:

pytest tests/test_token_usage.py -q
pytest tests/test_idle_concerns.py
pytest tests/test_entrypoint.py tests/test_swarm.py tests/test_swarm_backend.py tests/test_coral.py tests/test_init.py

The same target logic passed when the external plugin was disabled, for example:

pytest tests/test_token_usage.py -q -p no:randomly
# 23 passed

pytest -p no:randomly tests/test_idle_concerns.py
# 22 passed

Why this matters

New contributors and agents can misread this as a source regression. The project should either isolate itself from ambient pytest plugins or configure pytest so pytest-randomly cannot break setup/teardown before assertions run.

Suggested fix

Pin project test behavior in pytest configuration or tests/conftest.py, then verify with the default python -m pytest path and targeted test commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginfra基础设施/工程化phase:1Phase 1: 基础稳固priority:p0Must fix before reliable development/release

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions