Opened 2 hours ago

Last modified 2 hours ago

#36596 new Bug

django_test_expected_failures has no effect on the parallel test runner in "spawn" mode

Reported by: Jacob Walls Owned by:
Component: Testing framework Version: dev
Severity: Normal Keywords: multiprocessing
Cc: Tim Graham Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The django_test_expected_failures method has no effect on the parallel test runner in "spawn" multiprocessing mode, because it uses setattr to monkey-patch a class, and that patching is lost when workers are spawned.

To reproduce:

  • add multiprocessing.set_start_method("spawn") near the top of runtests.py if not running on MacOS or Windows
  • adjust postgres database settings to include "OPTIONS": { "server_side_binding": True} (to trigger an expected failure),
  • ./runtests.py aggregation.tests --settings=test_postgres --parallel=1 : passes
  • ./runtests.py aggregation.tests --settings=test_postgres: fails

Python will be defaulting all systems into "spawn" by default in Python 3.14, so we're about to see more traffic into this.

Change History (1)

comment:1 by Simon Charette, 2 hours ago

Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top