GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.12] gh-108834: Sync libregrtest with the main branch by vstinner · Pull Request #108966 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 5, 2023

Copy link
Copy Markdown
Member
  • 2cf86ef Mark slow test methods with @requires_resource('cpu') #108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') #108480)
  • 4f7e7b9 regrtest should re-run failed tests in subprocesses #108834: regrtest --fail-rerun exits with code 5 (gh-108834: regrtest --fail-rerun exits with code 5 #108896)
  • 3f81740 regrtest should re-run failed tests in subprocesses #108834: regrtest reruns failed tests in subprocesses (gh-108834: regrtest reruns failed tests in subprocesses #108839)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vstinner and others added 3 commits September 6, 2023 00:34
@vstinner
pythongh-108834: regrtest reruns failed tests in subprocesses (python…
3f81740
…#108839)

When using --rerun option, regrtest now re-runs failed tests
in verbose mode in fresh worker processes to have more
deterministic behavior. So it can write its final report even
if a test killed a worker progress.

Add --fail-rerun option to regrtest: exit with non-zero exit code
if a test failed pass passed when re-run in verbose mode (in a
fresh process). That's now more useful since tests can pass
when re-run in a fresh worker progress, whereas they failed
when run after other tests when tests are run sequentially.

Rename --verbose2 option (-w) to --rerun. Keep --verbose2 as a
deprecated alias.

Changes:

* Fix and enhance statistics in regrtest summary. Add "(filtered)"
  when --match and/or --ignore options are used.
* Add RunTests class.
* Add TestResult.get_rerun_match_tests() method
* Rewrite code to serialize/deserialize worker arguments as JSON
  using a new WorkerJob class.
* Fix stats when a test is run with --forever --rerun.
* If failed test names cannot be parsed, log a warning and don't
  filter tests.
* test_regrtest.test_rerun_success() now uses a marker file, since
  the test is re-run in a separated process.
* Add tests on normalize_test_name() function.
* Add test_success() and test_skip() tests to test_regrtest.

(cherry picked from commit 31c2945)
@vstinner
pythongh-108834: regrtest --fail-rerun exits with code 5 (python#108896)
4f7e7b9
When the --fail-rerun option is used and a test fails and then pass,
regrtest now uses exit code 5 ("rerun) instead of 2 ("bad test").

(cherry picked from commit 1170d5a)
@serhiy-storchaka @vstinner
pythongh-108416: Mark slow but not CPU bound test methods with requir…
2cf86ef
…es_resource('walltime') (pythonGH-108480)

(cherry picked from commit 1e0d627)
@vstinner
vstinner requested review from a team, gpshead, rhettinger and vsajip as code owners September 5, 2023 22:36
@bedevere-bot bedevere-bot added the awaiting core review label Sep 5, 2023
@vstinner
Manually sync Lib/test/libregrtest/ from main
e26b17f
@vstinner vstinner changed the title [3.12] Sync libregrtest with the main branch [3.12] gh-108834: Sync libregrtest with the main branch Sep 5, 2023
@bedevere-bot bedevere-bot mentioned this pull request Sep 4, 2023
regrtest should re-run failed tests in subprocesses #108834
Closed
@vstinner

vstinner commented Sep 5, 2023

Copy link
Copy Markdown
Member Author

This PR is a backport of PR #108839: gh-108834: regrtest reruns failed tests in subprocesses.

I had to include some others changes to keep libregrest in sync with main, and avoid futur merge conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead

gpshead commented Sep 5, 2023

Copy link
Copy Markdown
Member

#108923 includes part of this already.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Sep 6, 2023

Copy link
Copy Markdown
Member Author

@gpshead:

#108923 includes part of this already.

The problem is that regrtest changes were not backported in the same order than main changes :-( And so git cherry-pick is unhappy and creates conflicts. I almost lost @serhiy-storchaka's change about test_main(), but I catched it and fixed it.

I checked manually that at the end, files are the same in the two branches. Now, the remaining change is:

diff -u Lib/test/libregrtest/utils.py ../main/Lib/test/libregrtest/utils.py
--- Lib/test/libregrtest/utils.py	2023-09-06 00:39:26.893256876 +0200
+++ ../main/Lib/test/libregrtest/utils.py	2023-09-06 00:27:30.431075564 +0200
@@ -228,6 +228,11 @@
     ldflags_nodist = sysconfig.get_config_var('PY_LDFLAGS_NODIST') or ''
 
     build = []
+
+    # --disable-gil
+    if sysconfig.get_config_var('Py_NOGIL'):
+        build.append("nogil")
+
     if hasattr(sys, 'gettotalrefcount'):
         # --with-pydebug
         build.append('debug')

I could backport it as well (it does nothing in 3.12), but I chose to skip it for now :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger
rhettinger removed their request for review September 7, 2023 14:25
@Yhg1s
Yhg1s merged commit 0855b2c into python:3.12 Sep 8, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Sep 8, 2023
@vstinner
vstinner deleted the regrtest312 branch September 8, 2023 13:36
@vstinner vstinner added the needs backport to 3.11 only security fixes label Sep 11, 2023
@miss-islington

miss-islington commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

Sorry, @vstinner and @Yhg1s, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 0855b2c8b69f02f86f837875acda148479e6a061 3.11

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned Yhg1s Sep 11, 2023
@hugovk hugovk removed the needs backport to 3.11 only security fixes label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Yhg1s Yhg1s

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@vstinner @gpshead @miss-islington @hugovk @Yhg1s @bedevere-bot @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.