[Django] #25516: Debugging with pdb in parallel tests

9 views
Skip to first unread message

Django

unread,
Oct 6, 2015, 11:59:27 AM10/6/15
to django-...@googlegroups.com
#25516: Debugging with pdb in parallel tests
--------------------------------------+----------------------------
Reporter: yellowcap | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: 1.9a1
Severity: Normal | Keywords: parallel tests
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+----------------------------
I regularly use the testing framework to run code I am working on and use
pdb/ipdb to halt the execution and do some "manual" testing.

In parallel testing mode I was not able to do that, as the pdb.set_trace()
statement exits automatically. I guess that this is could be expected and
maybe desired behaviour, but if not it would be nice to be able to ipdb
into tests run in parallel as well.

It took me a while to find the reason for the automatic exits, so if its
not possible to pdb into parlallel tests, maybe adding a line or two in
the documentation about this could be helpful for others.

--
Ticket URL: <https://code.djangoproject.com/ticket/25516>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 6, 2015, 12:47:44 PM10/6/15
to django-...@googlegroups.com
#25516: Debugging with pdb in parallel tests
-------------------------------------+-------------------------------------
Reporter: yellowcap | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Testing framework | Version: 1.9a1
Severity: Normal | Resolution:

Keywords: parallel tests | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

There is no way this can work. We should document this as a known
limitation.

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:1>

Django

unread,
Oct 6, 2015, 12:57:43 PM10/6/15
to django-...@googlegroups.com
#25516: Debugging with pdb in parallel tests
--------------------------------------+------------------------------------

Reporter: yellowcap | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.9a1
Severity: Normal | Resolution:
Keywords: parallel tests | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1
* component: Testing framework => Documentation
* stage: Unreviewed => Accepted


Comment:

Good enough?
{{{
#!diff
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index a48a704..801f9a4 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -1267,6 +1267,10 @@ correctly:
This feature isn't available on Windows. It doesn't work with the Oracle
database backend either.

+If you want to use :mod:`pdb` while debugging tests, you must disable
parallel
+execution (``--parallel=1``). You'll see something like ``bdb.BdbQuit``
if you
+don't.
+
.. warning::

When test parallelization is enabled and a test fails, Django may be
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:2>

Django

unread,
Oct 6, 2015, 1:12:38 PM10/6/15
to django-...@googlegroups.com
#25516: Debugging with pdb in parallel tests
--------------------------------------+------------------------------------

Reporter: yellowcap | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.9a1
Severity: Normal | Resolution:
Keywords: parallel tests | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by aaugustin):

Yes. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:3>

Django

unread,
Oct 6, 2015, 1:27:55 PM10/6/15
to django-...@googlegroups.com
#25516: Debugging with pdb in parallel tests
--------------------------------------+------------------------------------
Reporter: yellowcap | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.9a1
Severity: Normal | Resolution: fixed

Keywords: parallel tests | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"cb15ceb5555de0799210a0ce37e744fd4f284b36" cb15ceb5]:
{{{
#!CommitTicketReference repository=""
revision="cb15ceb5555de0799210a0ce37e744fd4f284b36"
Fixed #25516 -- Documented that parallel test excution doesn't work with
pdb.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:4>

Django

unread,
Oct 6, 2015, 1:28:02 PM10/6/15
to django-...@googlegroups.com
#25516: Debugging with pdb in parallel tests
--------------------------------------+------------------------------------
Reporter: yellowcap | Owner: nobody

Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.9a1
Severity: Normal | Resolution: fixed
Keywords: parallel tests | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"2f9bc9933417d4a2b4b0196cfd9e7e886500e98d" 2f9bc99]:
{{{
#!CommitTicketReference repository=""
revision="2f9bc9933417d4a2b4b0196cfd9e7e886500e98d"
[1.9.x] Fixed #25516 -- Documented that parallel test excution doesn't
work with pdb.

Backport of cb15ceb5555de0799210a0ce37e744fd4f284b36 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:5>

Django

unread,
Oct 6, 2015, 1:28:53 PM10/6/15
to django-...@googlegroups.com
#25516: Document that pdb isn't compatible with parallel test runner
--------------------------------------+------------------------------------
Reporter: yellowcap | Owner: nobody

Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.9a1
Severity: Normal | Resolution: fixed
Keywords: parallel tests | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:6>

Django

unread,
Oct 6, 2015, 2:07:33 PM10/6/15
to django-...@googlegroups.com
#25516: Document that pdb isn't compatible with parallel test runner
--------------------------------------+------------------------------------
Reporter: yellowcap | Owner: nobody

Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.9a1
Severity: Normal | Resolution: fixed
Keywords: parallel tests | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by yellowcap):

Good to be certain about how to handle pdb. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/25516#comment:7>

Reply all
Reply to author
Forward
0 new messages