Skip to content

gh-94675: Add a regression test for rjsmin re slowdown - #94685

Merged
gpshead merged 6 commits into
python:mainfrom
hroncok:test_regression_gh94675
Aug 3, 2022
Merged

gpshead merged 6 commits into
python:mainfrom
hroncok:test_regression_gh94675

Conversation

@hroncok

@hroncok hroncok commented Jul 8, 2022 •

Copy link
Copy Markdown
Contributor

@hroncok

hroncok commented Jul 8, 2022

Copy link
Copy Markdown
Contributor Author

I can confirm that when cherry-picked on 3.11.0b3, the test hangs. Will see what happens next. If you have some tips about how to make the tests fail when it takes longer than X seconds, other than using subprocess, please let me know.

Use multiprocessing to kill the test after SHORT_TIMEOUT.
@hroncok

hroncok commented Jul 8, 2022

Copy link
Copy Markdown
Contributor Author

If you have some tips about how to make the tests fail when it takes longer than X seconds, other than using subprocess, please let me know.

I've used multiprocessing.

Comment thread Lib/test/test_re.py
Comment thread Misc/NEWS.d/next/Tests/2022-07-08-12-22-00.gh-issue-94675.IiTs5f.rst Outdated
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
@hroncok

This comment was marked as outdated.

Comment thread Lib/test/test_re.py Outdated
@AlexWaygood AlexWaygood added the needs backport to 3.11 only security fixes label Jul 8, 2022

@hauntsaninja hauntsaninja left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great to me.

If there's concern over the use of multiprocessing, note that "tests that run effectively forever when broken" are a different category to me than "does not take too long" — as long as the test suite does not complete successfully, we'll detect the regression ;-)

Here's a recent example of a regression test that runs forever when regressed: #93815

@tiran

tiran commented Jul 8, 2022

Copy link
Copy Markdown
Member

My concern not about multiprocessing per se. The commit would have broken our WebAssembly buildbots. Neither WASI nor Emscripten support fork() or creation of subprocesses.

hroncok added a commit to fedora-python/cpython that referenced this pull request Jul 11, 2022
This tests a speed regression in the re module
which prevented chromium from building in Fedora.

python#94685
@hroncok

hroncok commented Jul 19, 2022

Copy link
Copy Markdown
Contributor Author

What can I do to get this merged? It was reviewed and approved. Thanks.

@gpshead gpshead self-assigned this Jul 19, 2022
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 19, 2022
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 7a03947 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 19, 2022
@gpshead

gpshead commented Jul 19, 2022

Copy link
Copy Markdown
Member

I can merge it, I queued a buildbot run first to see if the existing chosen timeout is an obvious issue on any.

@hroncok

hroncok commented Jul 19, 2022

Copy link
Copy Markdown
Contributor Author

Thanks. The timeout is larger than necessary by magnitudes, but better safe than sorry.

@hroncok

hroncok commented Jul 26, 2022

Copy link
Copy Markdown
Contributor Author

Where do I see the buildbot result?

@tiran

tiran commented Jul 26, 2022

Copy link
Copy Markdown
Member

Let me update and re-run the buildbots again.

@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 26, 2022
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit 54b7abf 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 26, 2022
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Jul 26, 2022
This tests a speed regression in the re module
which prevented chromium from building in Fedora.

python#94685
@gpshead
gpshead merged commit fe23c00 into python:main Aug 3, 2022
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @hroncok for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 3, 2022
@bedevere-bot

Copy link
Copy Markdown

GH-95630 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 3, 2022
…H-94685)

Adds a regression test for an re slowdown observed by rjsmin.
Uses multiprocessing to kill the test after SHORT_TIMEOUT.

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Co-authored-by: Christian Heimes <christian@python.org>
(cherry picked from commit fe23c00)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
miss-islington added a commit that referenced this pull request Aug 3, 2022
Adds a regression test for an re slowdown observed by rjsmin.
Uses multiprocessing to kill the test after SHORT_TIMEOUT.

Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Co-authored-by: Christian Heimes <christian@python.org>
(cherry picked from commit fe23c00)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@hroncok
hroncok deleted the test_regression_gh94675 branch August 5, 2022 09:58
@hroncok

hroncok commented Aug 5, 2022

Copy link
Copy Markdown
Contributor Author

@gpshead Thanks for merging.

daandemeyer pushed a commit to daandemeyer/python-rpm that referenced this pull request Nov 17, 2022
…uilding

For details, see python/cpython#94675

Backported from upstream 3.11 branch + python/cpython#94685

Needs bootstrap for test_distutils (assert _sre.MAGIC == MAGIC, "SRE module mismatch").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir topic-regex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants