Skip to content

[tests]: Fix incorrect usage of support.requires_gil_enabled #118170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Apr 23, 2024

test_capi.test_mem before:

./python.exe -m test -v test_capi -m PyMemMallocDebugTests
== CPython 3.13.0a6+ (heads/main-dirty:1446024124, Apr 23 2024, 08:21:10) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit-Mach-O little-endian
== Python build: debug
== cwd: /Users/admin/Projects/cpython/build/test_python_worker_6699æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 359039614
0:00:00 load avg: 3.50 Run 1 test sequentially
0:00:00 load avg: 3.50 [1/1] test_capi

----------------------------------------------------------------------
Ran 0 tests in 0.000s

NO TESTS RAN
test_capi ran no tests

== Tests result: NO TESTS RAN ==

1 test run no tests:
    test_capi

Total duration: 133 ms
Total tests: run=0 (filtered)
Total test files: run=1/1 (filtered) run_no_tests=1
Result: NO TESTS RAN

After:

./python.exe -m test -v test_capi -m PyMemMallocDebugTests
== CPython 3.13.0a6+ (heads/main-dirty:1446024124, Apr 23 2024, 08:21:10) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit-Mach-O little-endian
== Python build: debug
== cwd: /Users/admin/Projects/cpython/build/test_python_worker_6722æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 2140682917
0:00:00 load avg: 1.72 Run 1 test sequentially
0:00:00 load avg: 1.72 [1/1] test_capi
test_api_misuse (test.test_capi.test_mem.PyMemMallocDebugTests.test_api_misuse) ... ok
test_buffer_overflow (test.test_capi.test_mem.PyMemMallocDebugTests.test_buffer_overflow) ... ok
test_pymem_malloc_without_gil (test.test_capi.test_mem.PyMemMallocDebugTests.test_pymem_malloc_without_gil) ... ok
test_pyobject_forbidden_bytes_is_freed (test.test_capi.test_mem.PyMemMallocDebugTests.test_pyobject_forbidden_bytes_is_freed) ... ok
test_pyobject_freed_is_freed (test.test_capi.test_mem.PyMemMallocDebugTests.test_pyobject_freed_is_freed) ... ok
test_pyobject_malloc_without_gil (test.test_capi.test_mem.PyMemMallocDebugTests.test_pyobject_malloc_without_gil) ... ok
test_pyobject_null_is_freed (test.test_capi.test_mem.PyMemMallocDebugTests.test_pyobject_null_is_freed) ... ok
test_pyobject_uninitialized_is_freed (test.test_capi.test_mem.PyMemMallocDebugTests.test_pyobject_uninitialized_is_freed) ... ok
test_set_nomemory (test.test_capi.test_mem.PyMemMallocDebugTests.test_set_nomemory) ... ok

----------------------------------------------------------------------
Ran 9 tests in 0.312s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 453 ms
Total tests: run=9 (filtered)
Total test files: run=1/1 (filtered)
Result: SUCCESS

The same as in #118079 is applied to the test_gdb.test_backtrace.test_threads.

@Eclips4 Eclips4 requested a review from colesbury April 23, 2024 05:37
@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Apr 23, 2024
@Eclips4 Eclips4 added skip issue skip news tests Tests in the Lib/test dir awaiting review and removed tests Tests in the Lib/test dir awaiting review labels Apr 23, 2024
Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

Thanks!

@colesbury colesbury merged commit 1723c76 into python:main Apr 25, 2024
42 checks passed
@Eclips4 Eclips4 deleted the fix-incorrect-calls branch April 25, 2024 17:44
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu NoGIL Refleaks 3.x has failed when building commit 1723c76.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1226/builds/1765) and take a look at the build logs.
  4. Check if the failure is related to this commit (1723c76) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1226/builds/1765

Failed tests:

  • test.test_multiprocessing_spawn.test_misc
  • test.test_multiprocessing_spawn.test_manager
  • test_eintr

Failed subtests:

  • test_all - test.test_eintr.EINTRTests.test_all
  • test_wait_integer - test.test_multiprocessing_spawn.test_misc.TestWait.test_wait_integer
  • test_lockf - main.FNTLEINTRTest.test_lockf
  • test_flock - main.FNTLEINTRTest.test_flock

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 5176, in test_wait_integer
    self.assertLess(delta, expected + 2)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
AssertionError: 6.4060303419828415 not less than 5


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_eintr.py", line 535, in test_flock
    self._lock(fcntl.flock, "flock")
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_eintr.py", line 517, in _lock
    raise Exception("failed to sync child in %.1f sec" % dt)
Exception: failed to sync child in 300.2 sec


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/test_eintr.py", line 17, in test_all
    script_helper.run_test_script(script)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/support/script_helper.py", line 316, in run_test_script
    raise AssertionError(f"{name} failed")
AssertionError: script _test_eintr.py failed


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 2074, in test_timeout
    self.run_threads(self._test_timeout_f, (self.barrier, results))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 1900, in run_threads
    f(*args)
    ~^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 2060, in _test_timeout_f
    i = barrier.wait()
        ~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 1108, in wait
    return self._callmethod('wait', (timeout,))
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 840, in _callmethod
    raise convert_to_error(kind, result)
threading.BrokenBarrierError


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
    ~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 1847, in task
    self.f(*self.args)
    ~~~~~~^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 2060, in _test_timeout_f
    i = barrier.wait()
        ~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 1108, in wait
    return self._callmethod('wait', (timeout,))
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 840, in _callmethod
    raise convert_to_error(kind, result)
threading.BrokenBarrierError
Process Process-182:
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
    ~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 1847, in task
    self.f(*self.args)
    ~~~~~~^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 2060, in _test_timeout_f
    i = barrier.wait()
        ~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 1108, in wait
    return self._callmethod('wait', (timeout,))
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 840, in _callmethod
    raise convert_to_error(kind, result)
threading.BrokenBarrierError
Process Process-183:
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
    ~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 1847, in task
    self.f(*self.args)
    ~~~~~~^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 2060, in _test_timeout_f
    i = barrier.wait()
        ~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 1108, in wait
    return self._callmethod('wait', (timeout,))
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 840, in _callmethod
    raise convert_to_error(kind, result)
threading.BrokenBarrierError
Process Process-185:
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
    ~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 1847, in task
    self.f(*self.args)
    ~~~~~~^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line 2060, in _test_timeout_f
    i = barrier.wait()
        ~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 1108, in wait
    return self._callmethod('wait', (timeout,))
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/multiprocessing/managers.py", line 840, in _callmethod
    raise convert_to_error(kind, result)
threading.BrokenBarrierError
ERROR


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_eintr.py", line 532, in test_lockf
    self._lock(fcntl.lockf, "lockf")
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/_test_eintr.py", line 517, in _lock
    raise Exception("failed to sync child in %.1f sec" % dt)
Exception: failed to sync child in 300.2 sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants