Skip to content

test_repl: Warning -- reap_children() reaped child process 3457256 #120635

Description

@vstinner

On the "AMD64 Debian PGO 3.x" buildbot worker, test_pyrepl fails with "env changed" because a child process is not awaited explicitly.

build: https://buildbot.python.org/all/#/builders/249/builds/8909

1:17:07 load avg: 20.12 [453/478/1] test_pyrepl failed (env changed) (37.4 sec)
test_empty (test.test_pyrepl.test_input.KeymapTranslatorTests.test_empty) ... ok
test_push_character_key (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_character_key) ... ok
test_push_character_key_with_stack (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_character_key_with_stack) ... ok
(...)
test.test_pyrepl.test_windows_console (unittest.loader.ModuleSkipped.test.test_pyrepl.test_windows_console) ... skipped 'test only relevant on win32'

----------------------------------------------------------------------
Ran 116 tests in 35.634s

OK (skipped=2)
Warning -- reap_children() reaped child process 3457256

Linked PRs

Activity

  1. vstinner commented on Jun 17, 2024

    @vstinner
    MemberAuthor

    Sadly, I fail to reproduce the issues locally.

  2. encukou commented on Jun 18, 2024

    @encukou
    Member

    The commits added for the first failed run were 1b62bce, 86a8a1c & 939c201. One of them adds a pyrepl test that runs a subprocess:

  3. added 2 commits that reference this issue on Jun 18, 2024
  4. vstinner commented on Jun 18, 2024

    @vstinner
    MemberAuthor

    I managed to reproduce the issue with this change:

    diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py
    index 41ba5959a1..0c22260741 100644
    --- a/Lib/test/test_pyrepl/test_pyrepl.py
    +++ b/Lib/test/test_pyrepl/test_pyrepl.py
    @@ -887,7 +887,7 @@ def run_repl(self, repl_input: str | list[str], env: dict | None = None) -> tupl
             os.close(master_fd)
             os.close(slave_fd)
             try:
    -            exit_code = process.wait(timeout=SHORT_TIMEOUT)
    +            exit_code = process.wait(timeout=1.0)
             except subprocess.TimeoutExpired:
                 process.kill()
                 exit_code = process.returncode
    

    And the command:

    ./python -m test test_pyrepl -u all -W -F -j100 --fail-env-changed -m test_dumb_terminal_exits_cleanly -m test_exposed_globals_in_repl
    
  5. vstinner commented on Jun 18, 2024

    @vstinner
    MemberAuthor

    I wrote a fix: #120676.

  6. added a commit that references this issue on Jun 19, 2024
  7. added a commit that references this issue on Jun 19, 2024
  8. added a commit that references this issue on Jun 19, 2024
  9. added a commit that references this issue on Jun 30, 2024
  10. added a commit that references this issue on Jul 11, 2024
  11. added a commit that references this issue on Jul 17, 2024
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

    testsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions