Opened 2 months ago

Closed 3 weeks ago

Last modified 2 weeks ago

#36596 closed Bug (fixed)

django_test_skips and django_test_expected_failures have no effect on the parallel test runner in "spawn" mode

Reported by: Jacob Walls Owned by: Mariusz Felisiak
Component: Testing framework Version: dev
Severity: Normal Keywords: multiprocessing
Cc: Tim Graham Triage Stage: Ready for checkin
Has patch: yes 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 (8)

comment:1 by Simon Charette, 2 months ago

Triage Stage: UnreviewedAccepted

comment:2 by Jacob Walls, 2 months ago

Description: modified (diff)

comment:3 by titilayo odufowoke, 2 months ago

Owner: set to titilayo odufowoke
Status: newassigned

comment:4 by Natalia Bidart, 3 weeks ago

Summary: django_test_expected_failures has no effect on the parallel test runner in "spawn" modedjango_test_skips and django_test_expected_failures have no effect on the parallel test runner in "spawn" mode

comment:5 by Jacob Walls, 3 weeks ago

Has patch: set
Owner: changed from titilayo odufowoke to Mariusz Felisiak

comment:6 by Jacob Walls, 3 weeks ago

Triage Stage: AcceptedReady for checkin

comment:7 by Jacob Walls <jacobtylerwalls@…>, 3 weeks ago

Resolution: fixed
Status: assignedclosed

In 9ba3f74a:

Fixed #36596 -- Made parallel test runner respect django_test_skips and django_test_expected_failures.

comment:8 by Natalia <124304+nessita@…>, 2 weeks ago

In e217139f:

[6.0.x] Fixed #36596 -- Made parallel test runner respect django_test_skips and django_test_expected_failures.

Backport of 9ba3f74a46d15f9f2f45ad4ef8cdd245a888e58e from main.

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