Skip to content

codex keeps hanging out when runs pytest #6331

Closed

Description

@ihribernik

What version of Codex is running?

codex-cli 0.55.0

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

I am doing some refactoring in a Python/FastAPI project. In some cases, when I ask Codex to write test cases for me, it hangs when it tries to run pytest to execute the whole test suite (as shown in the image).
The test suite is small (around 17 short tests), but the execution gets stuck and never completes.

Image

What steps can reproduce the bug?

  1. activate a virtualenv
  2. launch codex
  3. ask to codex to run pytest

Uploaded thread: 019a5a65-84b5-75f1-b265-ae30a5761c18

What is the expected behavior?

codex must display/read the test result and continue with the task mentioned

Additional information

currently i am using ubuntu 24.04 inside wsl

Activity

  1. balboah commented on Nov 10, 2025

    @balboah

    experienced this with other commands as well, I believe it's related to spawning background processes.

    Here's a simple Makefile target example

    hang:
    		sleep 30 & \
    		kill -0 $$!

    If I run this, it returns instantly.
    If codex runs it, it stalls for the full sleep period of 30 seconds before I see any output. Doesn't matter if it's sandbox or with elevated permissions.

    It seems to not be able to fork processes into the background and continue with the next command.
    This breaks my test target that for example starts a local database to run tests against.

    version 0.56

  2. etraut-openai commented on Jan 17, 2026

    @etraut-openai
    Contributor

    Closing out old bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions