[Django] #29187: test_delete_signals occasionally fails when running all django tests

46 views
Skip to first unread message

Django

unread,
Mar 5, 2018, 1:31:16 PM3/5/18
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: nobody
Mulford |
Type: Bug | Status: new
Component: Testing | Version: 2.0
framework |
Severity: Normal | Keywords: tests, unit tests
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm unable to replicate this consistently (outside of random chance) but
occasionally test_delete_signals fails with the following error message
when running all of the django tests:

{{{
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$ python
tests/runtests.py
Testing against Django installed in
'/home/jakemulf/projects/open_source_projects/django/django' with up to 4
processes
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Creating test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
System check identified no issues (14 silenced).
.....................................................................................................................................................................................................................................................................................................................................x......................................................................................................................................................................................................s..........s.......ss..................................s..............................................................................................s.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................sssssssssssssssssssssssssssssssssssss.............................................sss..s...........................................s.............................................................................................................s......................................................................................................................................................................................s....................................................................s..s......................s.............................................s..............s..............................................................s.................................................s.s.......s.s.......................................................................s..............................................................................................................................................................................................s....................................................sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.F.....sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss..s..sssss............................s................................s.....................................................................................................s........ssss................................s.....s.s..........................................s.......................................................................s......s........................................s.........s....................................................................sssss.....................................................................................................................................................................s.............sss.........................................................................................................................ssssssssssss.............................................................................................................................................................................................................................................s......s......................sss.s....s.............................x..s..............x.............................................................................................s..........................................................................................................s.....................................................................................................s........................................................................................................................................................................................s.............................................................................................ssssssssssssssssssssssssss......................s.......ss............................................................................................................................s......................................................................................................................................................s.......................................................................................................................................................................sssssssssssssssssssssssssssssssssssssssssssssssssssssss.......ssssssssssssssssssssssssssssssssssssssssssssssssssssss.............................................................................................................................................................................................................................s........................................................................ssssss..............................................................................................................................................................................................................................s.....s...ssssssssssssssssssssss..........................................................................................................................................................................s..................................................................s............s..s.....ss.ssss.....ss.s......s...........s....s....................................s.........s...............ss.........................................................................................................................................................sss..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s.......................................................................................................................................................................................................................................................................................................................................................................................ss...................................................................................................................................ssssss......................................................................................................................................................................s.................................................................................................................................................................................................................................................................s..s.......................................................................................................................................................s...................................................s........................................................................................................sss.sssssssssss.....s...s..........s.................................................................................................................................................................s..............................................................................................................s..............ss............................sssssss..sssss..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................s....ssssssssss..............................sss......s............................s................ss...ss...s.s...........................................................................................................s.............s...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s.............................................................................................................................................................................................s............................................................................x.............................ss...........................................................................sssssssssss.s.sssss.ssssss.........................................................................................................................ssssssss.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
======================================================================
FAIL: test_delete_signals (signals.tests.SignalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.5/unittest/case.py", line 603, in run
self.tearDown()
File
"/home/jakemulf/projects/open_source_projects/django/tests/signals/tests.py",
line 32, in tearDown
self.assertEqual(self.pre_signals, post_signals)
File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual
assertion_func(first, second, msg=msg)
File "/usr/lib/python3.5/unittest/case.py", line 1029, in
assertTupleEqual
self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
File "/usr/lib/python3.5/unittest/case.py", line 1000, in
assertSequenceEqual
self.fail(msg)
File "/usr/lib/python3.5/unittest/case.py", line 665, in fail
raise self.failureException(msg)
AssertionError: Tuples differ: (1, 0, 2, 1) != (1, 0, 2, 0)

First differing element 3:
1
0

- (1, 0, 2, 1)
? ^

+ (1, 0, 2, 0)
? ^


----------------------------------------------------------------------
Ran 12143 tests in 135.413s

FAILED (failures=1, skipped=804, expected failures=4)
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$ python
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
}}}

Running the same test command again passes all tests.

I have not yet gotten the same error when isolating these signal tests
(python tests/runtests.py signals.tests.SignalTests)

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

Django

unread,
Mar 5, 2018, 6:35:11 PM3/5/18
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-----------------------------------+--------------------------------------
Reporter: Jacob Mulford | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit tests | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Jacob Mulford):

I added a print statement in 'tests/signals/tests.py' to see the
difference between 'signals.pre_delete.receivers' and
'signals.post_delete.receivers' and noticed that they were not the same
when running all of the unit tests compared to running just the
'signals.tests.SignalTests' tests.

Isolating the signals.tests.SignalTests unit tests

{{{
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$ python

tests/runtests.py signals.tests.SignalTests


Testing against Django installed in
'/home/jakemulf/projects/open_source_projects/django/django' with up to 4
processes
Creating test database for alias 'default'...

Creating test database for alias 'other'...

System check identified no issues (0 silenced).
[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.[((140297206139216, 37859832), <weakref at 0x7f997d224f48; to 'function'
at 0x7f997d228950 (clear_site_cache)>)]
[]
.
----------------------------------------------------------------------
Ran 7 tests in 0.016s

OK


Destroying test database for alias 'default'...
Destroying test database for alias 'other'...

(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$
}}}

Running all unit tests with success

{{{
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$ python
tests/runtests.py
Testing against Django installed in
'/home/jakemulf/projects/open_source_projects/django/django' with up to 4
processes
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Creating test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
System check identified no issues (14 silenced).

.....................................................................................................................................................................................................................................................................................................................................x................................................................................................................................................................................................................s.................................ss..s......................................s...................................s..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................sssssssssssssssssssssssssssssssssssss.............................................sss..s...........................................s...................................................................................................s................................................................................................................................................................................................s..........................................................s..s................................s...........................s.......................................................................s.s.......s.s........................s.......................s................................................................................................s................................................................................................................................................................................................................s....................[((139835895023952,
32229800), <weakref at 0x7f2e14d94ef8; to 'function' at 0x7f2e14d98950
(clear_site_cache)>), ((139835874889240, 39580856), <weakref at
0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18 (prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
.....[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to
'function' at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240,
39580856), <weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
[((139835895023952, 32229800), <weakref at 0x7f2e14d94ef8; to 'function'
at 0x7f2e14d98950 (clear_site_cache)>), ((139835874889240, 39580856),
<weakref at 0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18
(prevent_deletes)>)]
[]
.........sssssssssssss[((139835895023952, 32229800), <weakref at
0x7f2e14d94ef8; to 'function' at 0x7f2e14d98950 (clear_site_cache)>),
((139835874889240, 39580856), <weakref at 0x7f2e139f43b8; to 'function' at
0x7f2e13a64e18 (prevent_deletes)>)]
s[]
sssssssssssssssssssssssssssssssssssssssssssssssssssss[((139835895023952,
32229800), <weakref at 0x7f2e14d94ef8; to 'function' at 0x7f2e14d98950
(clear_site_cache)>), ((139835874889240, 39580856), <weakref at
0x7f2e139f43b8; to 'function' at 0x7f2e13a64e18 (prevent_deletes)>)]
[]
.......sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss..s..sssssssssssssssssssssssssssss............................s...........................................................................................................s.....................ssss.............................s................s.....s.s..........................................s......................................................................................s..................s.............s..s...........................................................................sssss.....................................................................................................................................................................s.............sss.........................................................................................................................ssssssssssss.............................................................................................................................................................................................................................................s......s.......s...............................x.................sss.s..s................x...........................................................................................s...............................................................................................................................................s.........................................................s...............................................................................................................................................................................................s.............................................................................................ssssssssssssssssssssssssss...................s......ss..................................................................................................................................................................s....................................................................................................................s.......................................................................................................................................................................sssssssssssssssssssssssssssssssssssssssssssssssssssssss.......ssssssssssssssssssssssssssssssssssssssssssssssssssssss.............................................................................................................................................................................................................................s........................................................................ssssss........................................................................................................................................................................s..........................s..ssssssssssssssssssssss............................................................................................................................................................................................................s..................................................s............s..s.....ss.ssss.....ss.s......s...........s....s....................................s.........s....................................ss....................................................................................................................................................sss.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s....................................................................................................................................................................................................................................................................................................................................................................................ss...........................................................................................................................................ssssss......................................................................................................................................................................s.............................................................................................................................................................................................................................................................s..s............................................................................................................................s...............................................................................s..........................s..........................................................................................................sss.sssssssssss...s...s....................................................................................................................................................s........................................................................................................s........................ss......sssssss..sssss................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s....ssssssssss........................................................sss.s.......s................ss...ss...s.s...........................................................................................................s.............s...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s................................................................................................................................sssssssssss.s.sssss.ssssss..........s............................................................................x.............................ss.......................................................................................................................................................................................................................................................ssssssss.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 12143 tests in 126.068s

OK (skipped=804, expected failures=4)


Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
}}}

Running all tests with failure on test_delete_signals

{{{
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$ python
tests/runtests.py
Testing against Django installed in
'/home/jakemulf/projects/open_source_projects/django/django' with up to 4
processes
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Creating test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
System check identified no issues (14 silenced).

.....................................................................................................................................................................................................................................................................................................................................x....................................................................................................................................................................................s.s.........................................ss.........................................................s.........................................s..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................sssssssssssssssssssssssssssssssssssss.............................................sss..s...........................................s...................................................................................................s................................................................................................................................................................................................s................................................................................s..s....s...........................s...................................................s.s.......s.s..................................................s..................................s.......................................................................................s............................................................................................................................................................................................s......................................[((139947131390288,
38479880), <weakref at 0x7f47fb0d8ef8; to 'function' at 0x7f47fb0dc950
(clear_site_cache)>), ((139947111254080, 45829352), <weakref at
0x7f47f9d38408; to 'function' at 0x7f47f9da8840 (prevent_deletes)>)]
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to 'function'
at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080, 45829352),
<weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to 'function'
at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080, 45829352),
<weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to 'function'
at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080, 45829352),
<weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to 'function'
at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080, 45829352),
<weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
.....[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to
'function' at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080,
45829352), <weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
.........sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss[((139947131390288,
38479880), <weakref at 0x7f47fb0d8ef8; to 'function' at 0x7f47fb0dc950
(clear_site_cache)>), ((139947111254080, 45829352), <weakref at
0x7f47f9d38408; to 'function' at 0x7f47f9da8840 (prevent_deletes)>)]
[]
sssssssssssssssssssssss[((139947131390288, 38479880), <weakref at
0x7f47fb0d8ef8; to 'function' at 0x7f47fb0dc950 (clear_site_cache)>),
((139947111254080, 45829352), <weakref at 0x7f47f9d38408; to 'function' at
0x7f47f9da8840 (prevent_deletes)>)]
s[]
ssssss[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to
'function' at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080,
45829352), <weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[]
ssss[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8; to
'function' at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080,
45829352), <weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss[((139947131390288,
38479880), <weakref at 0x7f47fb0d8ef8; to 'function' at 0x7f47fb0dc950
(clear_site_cache)>), ((139947111254080, 45829352), <weakref at
0x7f47f9d38408; to 'function' at 0x7f47f9da8840 (prevent_deletes)>)]
[]
sssssssssssssss[((139947131390288, 38479880), <weakref at 0x7f47fb0d8ef8;
to 'function' at 0x7f47fb0dc950 (clear_site_cache)>), ((139947111254080,
45829352), <weakref at 0x7f47f9d38408; to 'function' at 0x7f47f9da8840
(prevent_deletes)>)]
[]
ssssssssssssssssssssssssssssssssssssssss.F.....sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss..s..............................s...........................................................................................................s..........................s........ssss................................s.....s.s..........................................s......................................................................................s..................s.............s...s..........................................................................sssss.....................................................................................................................................................................s.............sss.........................................................................................................................ssssssssssss.............................................................................................................................................................................................................................................s......s.......s...............................x....s..............x...................sss.s.........................................................................................s..................................................................................s......................................................s...............................................................................................................................................................................................................................................................s.............................................................................................ssssssssssssssssssssssssss...................s.........ss............................................................................................................................................................................................................................................................s.......................s.......................................................................................................................................................................sssssssssssssssssssssssssssssssssssssssssssssssssssssss.......ssssssssssssssssssssssssssssssssssssssssssssssssssssss.............................................................................................................................................................................................................................s........................................................................ssssss..............................................................................................................................................................................................................................s.....s....................ssssssssssssssssssssss..........................................................................................................................................................................s..................................................................................ss....................................................................................................................................................sss.............................................................................................................................................................................................................................................................................................................................................................................................................................s............s..s.....ss.ssss.....ss.s......s...........s....s....................................s.........s..............................................................................................................s..................................................................................................................................................................................................................................................................................................................................................................................ss..........................................................................................................................................ssssss...............................................................................................................................................................................s...............................................................................................................................................................................................................................................................s..s................................................................................................................................................s...................................................s...........................................................................................................sss.sssssssssss..s...s..............................................................................................................................s.............................................s........................................................................................................s........................ss......sssssss..sssss....................................................................................................................................................................................................................................................................................................................................................................................................................................................................s....ssssssssss....................................................................................ssss........s................ss...ss...s.s......................................................................................................s.............s................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s....................................................................................................................................................................................sssssssssss.s.sssss.ssssss........s............................................................................x.............................ss................................................................................................................................................................................................ssssssss..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................


======================================================================
FAIL: test_delete_signals (signals.tests.SignalTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.5/unittest/case.py", line 603, in run
self.tearDown()
File
"/home/jakemulf/projects/open_source_projects/django/tests/signals/tests.py",

line 34, in tearDown


self.assertEqual(self.pre_signals, post_signals)
File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual
assertion_func(first, second, msg=msg)
File "/usr/lib/python3.5/unittest/case.py", line 1029, in
assertTupleEqual
self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
File "/usr/lib/python3.5/unittest/case.py", line 1000, in
assertSequenceEqual
self.fail(msg)
File "/usr/lib/python3.5/unittest/case.py", line 665, in fail
raise self.failureException(msg)
AssertionError: Tuples differ: (1, 0, 2, 1) != (1, 0, 2, 0)

First differing element 3:
1
0

- (1, 0, 2, 1)
? ^

+ (1, 0, 2, 0)
? ^


----------------------------------------------------------------------
Ran 12143 tests in 129.548s

FAILED (failures=1, skipped=804, expected failures=4)
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
(djangodev) jakemulf@jakemulf-
Aspire-E5-574G:~/projects/open_source_projects/django$
}}}

It looks like the value in 'signals.post_delete.receivers' becomes a dead
reference

{{{
[((139946820203112, 47003928), <weakref at 0x7f47ead241d8; dead>)]
}}}

The unit test still fails since the unit test is checking the length of
the signals, and this dead reference is still counted in the length
{{{
def setUp(self):
# Save up the number of connected signals so that we can check at
the
# end that all the signals we register get properly unregistered
(#9989)
self.pre_signals = (
len(signals.pre_save.receivers),
len(signals.post_save.receivers),
len(signals.pre_delete.receivers),
len(signals.post_delete.receivers),
)

def tearDown(self):
# All our signals got disconnected properly.
post_signals = (
len(signals.pre_save.receivers),
len(signals.post_save.receivers),
len(signals.pre_delete.receivers),
len(signals.post_delete.receivers),
)
self.assertEqual(self.pre_signals, post_signals)
}}}

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

Django

unread,
Mar 5, 2018, 7:17:26 PM3/5/18
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-------------------------------------+-------------------------------------
Reporter: Jacob Mulford | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:

Keywords: tests, unit tests | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Testing framework => Core (Other)
* stage: Unreviewed => Someday/Maybe


Comment:

I haven't seen that failure before, but if someone identifies the cause,
please let us know.

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

Django

unread,
Feb 6, 2019, 8:08:27 AM2/6/19
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-------------------------------------+-------------------------------------
Reporter: Jacob Mulford | Owner: nobody
Type: Bug | Status: new

Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit tests | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hans-Peter Jansen):

* cc: Hans-Peter Jansen (added)


Comment:

I see this very issue in OBS builds of Django, which typically build with
the Django testsuite enabled.

{{{
[ 264s]
======================================================================
[ 264s] FAIL: test_delete_signals (signals.tests.SignalTests)
[ 264s]
----------------------------------------------------------------------
[ 264s] Traceback (most recent call last):
[ 264s] File "/usr/lib64/python3.6/unittest/case.py", line 59, in
testPartExecutor
[ 264s] yield
[ 264s] File "/usr/lib64/python3.6/unittest/case.py", line 608, in run
[ 264s] self.tearDown()
[ 264s] File
"/home/abuild/rpmbuild/BUILD/Django-2.1.5/tests/signals/tests.py", line
32, in tearDown
[ 264s] self.assertEqual(self.pre_signals, post_signals)
[ 264s] File "/usr/lib64/python3.6/unittest/case.py", line 829, in
assertEqual
[ 264s] assertion_func(first, second, msg=msg)
[ 264s] File "/usr/lib64/python3.6/unittest/case.py", line 1039, in
assertTupleEqual
[ 264s] self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
[ 264s] File "/usr/lib64/python3.6/unittest/case.py", line 1010, in
assertSequenceEqual
[ 264s] self.fail(msg)
[ 264s] File "/usr/lib64/python3.6/unittest/case.py", line 670, in fail
[ 264s] raise self.failureException(msg)
[ 264s] AssertionError: Tuples differ: (1, 0, 2, 1) != (1, 0, 2, 0)
[ 264s]
[ 264s] First differing element 3:
[ 264s] 1
[ 264s] 0
[ 264s]
[ 264s] - (1, 0, 2, 1)
[ 264s] ? ^
[ 264s]
[ 264s] + (1, 0, 2, 0)
[ 264s] ? ^
[ 264s]
[ 264s]
[ 264s]
----------------------------------------------------------------------
[ 264s] Ran 12368 tests in 172.836s
}}}

These builds are in public here:
https://build.opensuse.org/package/show/home:frispete:python/python-Django

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

Django

unread,
Nov 11, 2022, 10:21:49 AM11/11/22
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-------------------------------------+-------------------------------------
Reporter: Jacob Mulford | Owner: nobody
Type: Bug | Status: new

Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit tests | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Zapletal):

Is anyone still seeing this test failure? Is there a way to move this
ticket forward, or should it remain open? It doesn't seem to match the
description of the "Someday/Maybe" triage stage here:
https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#someday-maybe

I can't reproduce the test failure locally.

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

Django

unread,
Mar 1, 2024, 9:22:16 AM3/1/24
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-------------------------------------+-------------------------------------
Reporter: Jacob Mulford | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit tests | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by bcail):

Yes, I've seen this error in the past month on Linux with python 3.12.
--
Ticket URL: <https://code.djangoproject.com/ticket/29187#comment:5>

Django

unread,
9:24 AM (3 hours ago) 9:24 AM
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-----------------------------------+---------------------------------------
Reporter: Jacob Mulford | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit tests | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+---------------------------------------
Changes (by Jacob Walls):

* owner: nobody => Jacob Walls
* stage: Someday/Maybe => Accepted
* status: new => assigned

Comment:

We see this frequently in our CI runs now. Based on the analysis in
comment:1, I think we just need to fix `setUp` to clear dead receivers.
--
Ticket URL: <https://code.djangoproject.com/ticket/29187#comment:6>

Django

unread,
10:03 AM (2 hours ago) 10:03 AM
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-----------------------------------+---------------------------------------
Reporter: Jacob Mulford | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit 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 Jacob Walls):

* has_patch: 0 => 1

Comment:

[https://github.com/django/django/pull/21445 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29187#comment:7>

Django

unread,
10:28 AM (2 hours ago) 10:28 AM
to django-...@googlegroups.com
#29187: test_delete_signals occasionally fails when running all django tests
-------------------------------------+-------------------------------------
Reporter: Jacob Mulford | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Core (Other) | Version: 2.0
Severity: Normal | Resolution:
Keywords: tests, unit tests | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

Comment:

Simon approved on GitHub.
--
Ticket URL: <https://code.djangoproject.com/ticket/29187#comment:8>
Reply all
Reply to author
Forward
0 new messages