This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Sporadic failures of test_weakset
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pitrou Nosy List: fdrake, koobs, pitrou, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-12-17 13:55 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue20006.patch pitrou, 2013-12-17 14:43
Messages (10)
msg206435 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-17 13:55
test_weakset often fails on FreeBSD. Fo example see http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%202.7/builds/285/steps/test/logs/stdio.

test test_weakset failed -- Traceback (most recent call last):
  File "/usr/home/buildbot/koobs-freebsd10/2.7.koobs-freebsd10/build/Lib/test/test_weakset.py", line 491, in test_weak_destroy_and_mutate_while_iterating
    self.assertTrue(u in s)
AssertionError: False is not true

Second run of this test is successful.
msg206439 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-17 14:02
Does it occur only on 2.7?
msg206442 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-17 14:08
I can't reproduce the failure after more than 2000 test runs.
Also, this failure is weird: the test is supposed to be deterministic.
msg206443 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-17 14:09
> Does it occur only on 2.7?

Don't know.
msg206445 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-17 14:15
Ah, it seems the failure can happen because of hash randomization.
msg206451 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-17 14:43
Here is a patch. The failure doesn't occur on 3.x because of f189da5bda26, which clearly looks misled now.
msg206455 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-17 14:56
> Ah, it seems the failure can happen because of hash randomization.

Indeed. With -R switch 1/8 of tests are failed.
msg206485 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-17 23:28
New changeset 226c37c209fc by Antoine Pitrou in branch '2.7':
Issue #20006: Fix sporadic failures in test_weakset.
http://hg.python.org/cpython/rev/226c37c209fc
msg206486 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-12-17 23:32
New changeset a3d86f80c899 by Antoine Pitrou in branch '3.3':
Issue #20006: Fix sporadic failures in test_weakset.
http://hg.python.org/cpython/rev/a3d86f80c899

New changeset 26d92a21f6cf by Antoine Pitrou in branch 'default':
Issue #20006: Fix sporadic failures in test_weakset.
http://hg.python.org/cpython/rev/26d92a21f6cf
msg206487 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-12-17 23:32
This was all my fault :) Thanks for reporting!
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64205
2013-12-17 23:32:42pitrousetstatus: open -> closed
resolution: fixed
messages: + msg206487

stage: patch review -> resolved
2013-12-17 23:32:10python-devsetmessages: + msg206486
2013-12-17 23:28:43python-devsetnosy: + python-dev
messages: + msg206485
2013-12-17 14:56:42serhiy.storchakasetmessages: + msg206455
2013-12-17 14:43:45pitrousetstage: patch review
components: + Tests
versions: + Python 3.3, Python 3.4
2013-12-17 14:43:36pitrousetfiles: + issue20006.patch
assignee: pitrou
messages: + msg206451

keywords: + patch
2013-12-17 14:15:54pitrousetmessages: + msg206445
2013-12-17 14:09:13serhiy.storchakasetmessages: + msg206443
2013-12-17 14:08:32pitrousetnosy: + koobs
messages: + msg206442
2013-12-17 14:02:55pitrousetmessages: + msg206439
2013-12-17 13:55:47serhiy.storchakacreate