Skip to content

tests: avoid fork from a threaded parent in consolidate exit regressions #801

Closed

Description

@cdeust

Pipeline40444948084, unit job121993924014, head
a1fc938 passes 10,911 tests but reports
two Python 3.12 DeprecationWarnings in
tests_py/hooks/test_consolidate_background_exit.py:

  • test_consolidate_background_does_not_close_store_without_the_fix
  • test_consolidate_background_closes_store_with_the_fix

Both reach multiprocessing/popen_fork.py:66. Python warns that fork() in a
multi-threaded process may deadlock the child.

Inspect why the test parent has threads at process creation. Make process
creation safe while preserving the original regression: the unfixed child
must demonstrate the store-exit problem and the fixed child must exit cleanly.
Do not suppress the warning or weaken either assertion. Run the focused tests
on hosted CI, with this warning treated as an error, then run the normal suite.

Evidence: https://github.com/cdeust/Cortex/actions/runs/40444948084/job/121993924014

Activity

  1. cdeust commented on Nov 6, 2026

    @cdeust
    OwnerAuthor

    CI autopilot : PR ouverte, #908 (commit 3cb7ab0).

    Cause racine : pyproject.toml fixe timeout_method = "thread". pytest-timeout lance donc un thread minuteur pour chaque test, et le parent est toujours multi-thread au moment de ctx.Process(...).start() avec le contexte fork. Preuve locale sur Python 3.12.3 : l'avertissement popen_fork.py:66 disparaît avec -o timeout=0. Le correctif lance l'enfant avec spawn : _child_main installe lui-même tous les patchs, les deux assertions restent inchangées et aucun avertissement n'est filtré. Localement, on obtient 2 passed sans l'avertissement, et aussi avec -W error::DeprecationWarning:multiprocessing.popen_fork.

    Non vérifié : le run CI hébergé avec l'avertissement transformé en erreur, ainsi que Python 3.11, 3.13 et 3.14, macOS et Windows.


    Generated by Claude Code

  2. cdeust commented on Nov 6, 2026

    @cdeust
    OwnerAuthor

    Fermée par #908 (fusionnée le 2026-11-06 par le résolveur, github-actions[bot] : le Closes #801 n'a pas déclenché la fermeture automatique).

    Critères de l'issue :

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions