classification
Title: Make tests more PyPy compatible
Type: enhancement Stage: patch review
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Carl.Friedrich.Bolz, Ronan.Lamy, benjamin.peterson, fijall, lukasz.langa, martin.panter, miss-islington, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2015-09-15 18:15 by serhiy.storchaka, last changed 2021-09-08 15:09 by lukasz.langa.

Files
File name Uploaded Description Edit
pypy_tests_gc_collect-2.7.patch serhiy.storchaka, 2015-09-15 18:15 Just add gc.collect() calls review
pypy_tests-2.7_full.patch serhiy.storchaka, 2015-09-16 07:33 Full difference between 2.7 tests in PyPy and CPython review
Pull Requests
URL Status Linked Edit
PR 28005 merged serhiy.storchaka, 2021-08-27 19:40
PR 28002 merged Carl.Friedrich.Bolz, 2021-08-28 18:29
PR 28016 merged miss-islington, 2021-08-28 18:33
PR 28017 merged serhiy.storchaka, 2021-08-28 18:41
PR 28021 merged serhiy.storchaka, 2021-08-29 09:21
PR 28022 merged miss-islington, 2021-08-29 10:23
PR 28023 merged serhiy.storchaka, 2021-08-29 10:27
PR 28027 merged serhiy.storchaka, 2021-08-29 11:10
PR 28028 merged serhiy.storchaka, 2021-08-29 11:16
Messages (18)
msg250789 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-15 18:15
PyPy includes modified Python 2.7 tests for testing compatibility. Some of changes skips tests for features that are not implemented in PyPy or are CPython specific, some reflects differences between error types or messages in CPython and PyPy, some are needed because PyPy doesn't use reference counting, some are workarounds for known PyPy or CPython bugs. The purpose of this issue is to port harmless non PyPy-specific changes. I'll split full patch on several parts for easier review.

The first patch in a series just adds gc.collect() or test.test_support.gc_collect() calls to force calling destructors or freeing memory.
msg250812 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-09-15 23:53
Left some comments. There are a few test cases that I suspect are relying on side effects of garbage collection to perform some other test, and it would be better to rework the test. In the other cases, I agree that actual garbage collection behaviour is being tested, and it makes sense to call gc_collect() or similar.
msg250816 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-16 05:22
Thank you for your comments Martin. I need a time to think over them and provide alternative solutions that less depend on garbage collecting. May be Maciej can answer questions about causes of some PyPy changes.
msg250824 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-16 07:33
Just for reference here is a full difference between 2.7 tests in PyPy and CPython. It makes tests fail in CPython and skips some tests or makes them too lenient.
msg250832 - (view) Author: Maciej Fijalkowski (fijall) * (Python committer) Date: 2015-09-16 08:54
Hi

I can answer precise questions, which tests are you asking about?

Note that if the point is to unify the test suite, would be cool to make changes to both pypy and cpython and not just change cpython one.
msg250835 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-09-16 10:32
Maciej: I put a few questions and comments in the code review. See the <https://bugs.python.org/review/25130/#ps15551> (also linked next to Serhiy’s first patch).
msg250836 - (view) Author: Maciej Fijalkowski (fijall) * (Python committer) Date: 2015-09-16 10:39
Hi

Looking through your comments, yes, maybe those tests or those things require fixing. We at pypy don't have enough will to fight python-dev most of the time, so the usual approach is to do "minimal hack that works" without trying to dwelve into why this or that works that way. Obviously feel free to fix the underlaying issue, we'll be happy to commit it to pypy
msg389367 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-03-23 02:16
With 2.7 EOL, is this still relevant?
msg400439 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-27 19:39
Unfortunately Martin's comments are not available now, after shutting down the Rietveld service.

Here is a new PR which contains extraction of PyPy changes related to calling gc.collect() for 3.8. I removed changes which look specific for PyPy and left changes which look common for every implementation without reference counting.
msg400492 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-28 18:33
New changeset eb263f9a356f5c5f21b8d5ce20bac92f31c40cad by Carl Friedrich Bolz-Tereick in branch 'main':
bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002)
https://github.com/python/cpython/commit/eb263f9a356f5c5f21b8d5ce20bac92f31c40cad
msg400496 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-28 19:24
New changeset 779b9aef4fb2750f57ce07f0efbc8ce8406e43ab by Miss Islington (bot) in branch '3.10':
bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28016)
https://github.com/python/cpython/commit/779b9aef4fb2750f57ce07f0efbc8ce8406e43ab
msg400497 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-28 19:24
New changeset 1046cd06b0e2f20b3be93de83d49b684956af98d by Serhiy Storchaka in branch '3.9':
[3.9] bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28017)
https://github.com/python/cpython/commit/1046cd06b0e2f20b3be93de83d49b684956af98d
msg400519 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-29 10:08
New changeset 07d3d54f4e84b1259b800884b202701f69e408d8 by Serhiy Storchaka in branch 'main':
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
https://github.com/python/cpython/commit/07d3d54f4e84b1259b800884b202701f69e408d8
msg400520 - (view) Author: miss-islington (miss-islington) Date: 2021-08-29 10:43
New changeset a49398b643b3a2e6f9cc39729c528eb1e4385b1a by Miss Islington (bot) in branch '3.10':
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
https://github.com/python/cpython/commit/a49398b643b3a2e6f9cc39729c528eb1e4385b1a
msg400522 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-29 11:03
New changeset dab74d68e3f8391cb4b404b397ab80e2e0188d1f by Serhiy Storchaka in branch '3.9':
[3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)
https://github.com/python/cpython/commit/dab74d68e3f8391cb4b404b397ab80e2e0188d1f
msg400523 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-29 11:04
New changeset 2a8127cafe1d196f858a3ecabf5f1df3eebf9a12 by Serhiy Storchaka in branch 'main':
bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)
https://github.com/python/cpython/commit/2a8127cafe1d196f858a3ecabf5f1df3eebf9a12
msg400526 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-29 12:08
New changeset 330aabbbbee39cbc556be01534b1dbf65d20f04c by Serhiy Storchaka in branch '3.9':
[3.9] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005). (GH-28028)
https://github.com/python/cpython/commit/330aabbbbee39cbc556be01534b1dbf65d20f04c
msg401387 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-09-08 15:09
New changeset 462c1f0403324efc27c11435da12b8d16f5387de by Serhiy Storchaka in branch '3.10':
[3.10] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005) (GH-28027)
https://github.com/python/cpython/commit/462c1f0403324efc27c11435da12b8d16f5387de
History
Date User Action Args
2021-09-08 15:09:06lukasz.langasetnosy: + lukasz.langa
messages: + msg401387
2021-08-29 12:08:35serhiy.storchakasetmessages: + msg400526
2021-08-29 11:16:29serhiy.storchakasetpull_requests: + pull_request26474
2021-08-29 11:10:41serhiy.storchakasetpull_requests: + pull_request26473
2021-08-29 11:04:43serhiy.storchakasetmessages: + msg400523
2021-08-29 11:03:15serhiy.storchakasetmessages: + msg400522
2021-08-29 10:43:51miss-islingtonsetmessages: + msg400520
2021-08-29 10:27:24serhiy.storchakasetpull_requests: + pull_request26469
2021-08-29 10:23:48miss-islingtonsetpull_requests: + pull_request26468
2021-08-29 10:08:10serhiy.storchakasetmessages: + msg400519
2021-08-29 09:21:50serhiy.storchakasetpull_requests: + pull_request26467
2021-08-28 19:24:42serhiy.storchakasetmessages: + msg400497
2021-08-28 19:24:09serhiy.storchakasetmessages: + msg400496
2021-08-28 18:41:15serhiy.storchakasetpull_requests: + pull_request26462
2021-08-28 18:33:59miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26461
2021-08-28 18:33:58serhiy.storchakasetmessages: + msg400492
2021-08-28 18:29:02Carl.Friedrich.Bolzsetnosy: + Carl.Friedrich.Bolz
pull_requests: + pull_request26460
2021-08-27 19:40:26serhiy.storchakasetpull_requests: + pull_request26447
2021-08-27 19:39:33serhiy.storchakasetmessages: + msg400439
versions: + Python 3.9, Python 3.10, Python 3.11, - Python 2.7, Python 3.4, Python 3.5, Python 3.6
2021-03-23 02:16:55terry.reedysetnosy: + terry.reedy
messages: + msg389367
2019-09-19 15:27:23Ronan.Lamysetnosy: + Ronan.Lamy
2015-09-16 10:39:14fijallsetmessages: + msg250836
2015-09-16 10:32:20martin.pantersetmessages: + msg250835
2015-09-16 08:54:53fijallsetmessages: + msg250832
2015-09-16 07:33:41serhiy.storchakasetfiles: + pypy_tests-2.7_full.patch

messages: + msg250824
2015-09-16 05:22:32serhiy.storchakasetmessages: + msg250816
2015-09-15 23:53:14martin.pantersetnosy: + martin.panter
messages: + msg250812
2015-09-15 18:15:24serhiy.storchakacreate