Opened 3 weeks ago

Last modified 3 weeks ago

#36596 assigned Bug

django_test_expected_failures has no effect on the parallel test runner in "spawn" mode — at Version 2

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 (last modified by Jacob Walls)

The django_test_expected_failures attribute 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 (2)

comment:1 by Simon Charette, 3 weeks ago

Triage Stage: UnreviewedAccepted

comment:2 by Jacob Walls, 3 weeks ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top