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 — GH-104584: Fix test_capi.test_counter_optimizer() when run twice by vstinner · Pull Request #106171 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Jun 28, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

test_counter_optimizer() and test_long_loop() of test_capi now create a new function at each call. Otherwise, the optimizer counters are not the expected values when the test is run more than once.

  • Issue: Pluggable optimizer API #104584

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner
pythonGH-104584: Fix test_capi.test_counter_optimizer() when run twice
24228b3
test_counter_optimizer() and test_long_loop() of test_capi now create
a new function at each call. Otherwise, the optimizer counters are
not the expected values when the test is run more than once.
@bedevere-bot bedevere-bot added awaiting core review tests Tests in the Lib/test dir labels Jun 28, 2023
@vstinner vstinner added skip news and removed tests Tests in the Lib/test dir awaiting core review labels Jun 28, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jun 28, 2023
Pluggable optimizer API #104584
Closed
@vstinner

vstinner commented Jun 28, 2023

Copy link
Copy Markdown
Member Author

test_capi currently fails on the Refleaks buildbots:

0:45:19 load avg: 1.15 Re-running test_capi in verbose mode (matching: test_counter_optimizer, test_long_loop)
beginning 6 repetitions
123456
test_counter_optimizer (test.test_capi.test_misc.TestOptimizerAPI.test_counter_optimizer) ... ok
test_long_loop (test.test_capi.test_misc.TestOptimizerAPI.test_long_loop)
Check that we aren't confused by EXTENDED_ARG ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.001s

OK
test_counter_optimizer (test.test_capi.test_misc.TestOptimizerAPI.test_counter_optimizer) ... FAIL
test_long_loop (test.test_capi.test_misc.TestOptimizerAPI.test_long_loop)
Check that we aren't confused by EXTENDED_ARG ... FAIL

======================================================================
FAIL: test_counter_optimizer (test.test_capi.test_misc.TestOptimizerAPI.test_counter_optimizer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.refleak/build/Lib/test/test_capi/test_misc.py", line 2386, in test_counter_optimizer
    self.assertEqual(opt.get_count(), 1000)
AssertionError: 0 != 1000

======================================================================
FAIL: test_long_loop (test.test_capi.test_misc.TestOptimizerAPI.test_long_loop)
Check that we aren't confused by EXTENDED_ARG
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.refleak/build/Lib/test/test_capi/test_misc.py", line 2408, in test_long_loop
    self.assertEqual(opt.get_count(), 10)
AssertionError: 0 != 10

----------------------------------------------------------------------
Ran 2 tests in 0.005s

FAILED (failures=2)
.test test_capi failed

cc @markshannon

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Jun 28, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Reproduce the issue with: ./python -m test -m test_counter_optimizer -m test_long_loop -v test_capi test_capi command.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner merged commit adaacf2 into python:main Jun 28, 2023
@vstinner
vstinner deleted the test_counter_optimizer branch June 28, 2023 02:41
@vstinner

vstinner commented Jun 28, 2023

Copy link
Copy Markdown
Member Author

Note: Python 3.12 is not affected.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gvanrossum gvanrossum mentioned this pull request Jun 28, 2023
test_capi fails if run with --forever argument #105273
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

2 participants

@vstinner @bedevere-bot
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 01402503 — 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.