Commit graph

30238 commits

Author SHA1 Message Date
Victor Stinner
350d89b795
[3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413) (#110427)
gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413)

Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase
the timeout depending on the --timeout option. For example, for a
test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT
of 20 seconds instead of 5 seconds before.

(cherry picked from commit 0db2f1475e)
2023-10-05 20:37:20 +00:00
Miss Islington (bot)
11137d3822
[3.12] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110430)
gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428)

Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.
(cherry picked from commit 5eae8dc2cb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 20:03:53 +00:00
Miss Islington (bot)
2ab41c8fbc
[3.12] gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416) (#110423)
gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416)

Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().
(cherry picked from commit 318f5df271)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 19:24:26 +00:00
Miss Islington (bot)
4a87f92724
[3.12] gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401) (#110405)
gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401)

NetworkConnectionAttributesTest of test_socket now always declare the
'cli' attribute, so clientTearDown() cannot fail with AttributeError.
(cherry picked from commit e37d4557c3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 17:01:59 +00:00
Miss Islington (bot)
09ec8153c6
[3.12] gh-110259: Fix f-strings with multiline expressions and format specs (GH-110271) (#110396)
gh-110259: Fix f-strings with multiline expressions and format specs (GH-110271)
(cherry picked from commit cc389ef627)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-10-05 14:07:25 +00:00
Hugo van Kemenade
e658413e55
[3.12] Lint: Remove files that no longer fail to parse (GH-110356) (#110360)
Remove files that no longer fail to parse
2023-10-04 15:31:03 +01:00
Victor Stinner
bbce8bd05d
[3.12] gh-109972: Enhance test_gdb (#110026) (#110351)
* gh-109972: Enhance test_gdb (#110026)

* Split test_pycfunction.py: add test_cfunction_full.py.
  Split the function into the following 6 functions. In verbose
  mode, these "pycfunction" tests now log each tested call.

  * test_pycfunction_noargs()
  * test_pycfunction_o()
  * test_pycfunction_varargs()
  * test_pycfunction_varargs_keywords()
  * test_pycfunction_fastcall()
  * test_pycfunction_fastcall_keywords()

* Move get_gdb_repr() to PrettyPrintTests.
* Replace DebuggerTests.get_sample_script() with SAMPLE_SCRIPT.
* Rename checkout_hook_path to CHECKOUT_HOOK_PATH.
* Rename gdb_version to GDB_VERSION_TEXT.
* Replace (gdb_major_version, gdb_minor_version) with GDB_VERSION.
* run_gdb() uses "backslashreplace" error handler instead of "replace".
* Add check_gdb() function to util.py.
* Enhance support.check_cflags_pgo(): check also for sysconfig
  PGO_PROF_USE_FLAG (if available) in compiler flags.
* Move some SkipTest checks to test_gdb/__init__.py.
* Elaborate why gdb cannot be tested on Windows: gdb doesn't support
  PDB debug symbol files.

(cherry picked from commit 757cbd4f29)

* gh-104736: Fix test_gdb tests on ppc64le with clang (#109360)

Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex:
Fedora 38). Search patterns in gdb "bt" command output to detect
when gdb fails to retrieve the traceback. For example, skip a test if
"Backtrace stopped: frame did not save the PC" is found.

(cherry picked from commit 44d9a71ea2)

* gh-110166: Fix gdb CFunctionFullTests on ppc64le clang build (#110331)

CFunctionFullTests now also runs "bt" command before "py-bt-full",
similar to CFunctionTests which also runs "bt" command before
"py-bt". So test_gdb can skip the test if patterns like "?? ()" are
found in the gdb output.

(cherry picked from commit 1de9406f91)
2023-10-04 11:34:28 +00:00
Victor Stinner
1d032ea3d6
[3.12] gh-109974: Fix threading lock_tests race conditions (#110057) (#110346)
* gh-109974: Fix threading lock_tests race conditions (#110057)

Fix race conditions in test_threading lock tests. Wait until a
condition is met rather than using time.sleep() with a hardcoded
number of seconds.

* Replace sleeping loops with support.sleeping_retry() which raises
  an exception on timeout.
* Add wait_threads_blocked(nthread) which computes a sleep depending
  on the number of threads. Remove _wait() function.
* test_set_and_clear(): use a way longer Event.wait() timeout.
* BarrierTests.test_repr(): wait until the 2 threads are waiting for
  the barrier. Use a way longer timeout for Barrier.wait() timeout.
* test_thread_leak() no longer needs to count
  len(threading.enumerate()): Bunch uses
  threading_helper.wait_threads_exit() internally which does it in
  wait_for_finished().
* Add BaseLockTests.wait_phase() which implements a timeout.
  test_reacquire() and test_recursion_count() use wait_phase().

(cherry picked from commit 4e356ad183)

* gh-109974: Fix more threading lock_tests race conditions (#110089)

* Add context manager on Bunch class.
* Bunch now catchs exceptions on executed functions and re-raise them
  at __exit__() as an ExceptionGroup.
* Rewrite BarrierProxy.test_default_timeout(). Use a single thread.
  Only check that barrier.wait() blocks for at least default timeout
  seconds.
* test_with(): inline _with() function.

(cherry picked from commit 743e3572ee)
2023-10-04 11:26:45 +00:00
Miss Islington (bot)
f53871e1e8
[3.12] gh-110332: Remove mentions of random.WichmannHill from test_zlib (GH-110334) (#110349)
gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334)
(cherry picked from commit e9f2352b7b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-04 11:25:13 +00:00
Miss Islington (bot)
1d87465005
[3.12] gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336) (#110338)
gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336)

test_unix_events tests using the multiprocessing module now call
multiprocessing.util._cleanup_tests().
(cherry picked from commit 1337765225)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-04 12:33:14 +02:00
Victor Stinner
8939221e91
[3.12] gh-109615: Fix support test_copy_python_src_ignore() (#109958) (#110340)
* gh-109615: Fix support test_copy_python_src_ignore() (#109958)

Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.

* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
  Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
  from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".

(cherry picked from commit b89ed9df39)

* gh-109615: Fix support test_copy_python_src_ignore() on WASM (#109970)

Not only check if src_dir exists, but look also for Lib/os.py
landmark.

(cherry picked from commit cc54bcf17b)

* gh-109615: Look for 'Modules' as landmark for test_copy_python_src_ignore (GH-110108)

(cherry picked from commit 20bc5f7c28)

* gh-109748: Fix again venv test_zippath_from_non_installed_posix() (#110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.

(cherry picked from commit 0def8c712b)

---------

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-10-04 10:27:12 +00:00
Victor Stinner
e7a61d34b7
[3.12] gh-109972: Split test_gdb.py into test_gdb package (#109977) (#110339)
gh-109972: Split test_gdb.py into test_gdb package (#109977)

Split test_gdb.py file into a test_gdb package made of multiple
tests, so tests can now be run in parallel.

* Create Lib/test/test_gdb/ directory.
* Split test_gdb.py into multiple files in Lib/test/test_gdb/
  directory.
* Move Lib/test/gdb_sample.py to Lib/test/test_gdb/ directory.
  Update get_sample_script(): use __file__ to locate gdb_sample.py.
* Move gdb_has_frame_select() and HAS_PYUP_PYDOWN to test_misc.py.
* Explicitly skip test_gdb on Windows. Previously, test_gdb was
  skipped even if gdb was available because of
  gdb_has_frame_select().

(cherry picked from commit 8f324b7ecd)
2023-10-04 10:26:24 +00:00
Miss Islington (bot)
35feda5bc9
[3.12] gh-110267: Add tests for pickling and copying PyStructSequence objects (GH-110272) (GH-110285)
(cherry picked from commit 2d4865d775)

Co-authored-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
2023-10-04 12:01:03 +03:00
Miss Islington (bot)
414f562081
[3.12] gh-109917: Fix test instability in test_concurrent_futures (GH-110306) (#110315)
gh-109917: Fix test instability in test_concurrent_futures (GH-110306)

The test had an instability issue due to the ordering of the dummy
queue operation and the real wakeup pipe operations. Both primitives
are thread safe but not done atomically as a single update and may
interleave arbitrarily. With the old order of operations this can lead
to an incorrect state where the dummy queue is full but the wakeup
pipe is empty. By swapping the order in clear() I think this can no
longer happen in any possible operation interleaving (famous last
words).
(cherry picked from commit a376a72bd9)

Co-authored-by: elfstrom <elfstrom@users.noreply.github.com>
2023-10-03 22:28:13 +00:00
Alex Waygood
4dac406f66
[3.12] Enable ruff on Lib/test/test_typing.py (#110179) (#110288)
Enable ruff on `Lib/test/test_typing.py` (#110179)
2023-10-03 15:13:22 +00:00
Victor Stinner
0745ab88e5
[3.12] gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) (#110098)
gh-110088, gh-109878: Fix test_asyncio timeouts (#110092)

Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.

(cherry picked from commit db0a258e79)
2023-10-02 19:35:29 +00:00
Victor Stinner
c188a13c8e
[3.12] gh-110031: Skip test_threading fork tests if ASAN (#110100) (#110103)
gh-110031: Skip test_threading fork tests if ASAN (#110100)

Skip test_threading tests using thread+fork if Python is built with
Address Sanitizer (ASAN).

(cherry picked from commit 86e76ab8af)
2023-10-02 19:31:12 +00:00
Alex Waygood
25bf0564c4
[3.12] Fix typos in docs and comments (#109619) (#109621)
Fix typos in docs and comments (#109619)

Co-authored-by: Heinz-Alexander Fuetterer <35225576+afuetterer@users.noreply.github.com>
2023-10-02 17:34:49 +00:00
Miss Islington (bot)
46e69576a9
[3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224)
gh-110178: Use fewer weakrefs in test_typing.py (GH-110194)

Confirmed that without the C changes from GH-108517, this test still segfaults with only 10 weakrefs.
(cherry picked from commit 732ad44cec)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-10-02 18:15:30 +01:00
Victor Stinner
f911d7ecd9
[3.12] gh-108963: using random to generate unique string in sys.intern test … (#110216)
gh-108963: using random to generate unique string in sys.intern test (#109491)

(cherry picked from commit 44b1e4ea48)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2023-10-02 17:48:42 +02:00
Miss Islington (bot)
b61a4da459
[3.12] gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on executable files (GH-109995) (#110202)
gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on executable files (GH-109995)

The default arguments for shutil.which() request an executable file, but extensionless files are not executable on Windows and should be ignored.
(cherry picked from commit 29b875bb93)

Co-authored-by: Charles Machalow <csm10495@gmail.com>
2023-10-02 17:48:30 +02:00
Miss Islington (bot)
10af2242f4
[3.12] gh-110160: Fix flaky test_find_periodic_pattern in string_tests (GH-110170) (#110182)
gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (GH-110170)
(cherry picked from commit 06faa9a39b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:48:17 +02:00
Victor Stinner
5245b97e13
[3.12] gh-109649: Enhance os.cpu_count() documentation (#110169)
* gh-109649: Enhance os.cpu_count() documentation

* Doc: Specify that os.cpu_count() counts *logicial* CPUs.
* Doc: Specify that os.sched_getaffinity(0) is related to the calling
  thread.
* Fix test_posix.test_sched_getaffinity(): restore the old CPU mask
  when the test completes!

* Restore removed text
2023-10-02 17:47:57 +02:00
Miss Islington (bot)
ce332aa8c5
[3.12] gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157) (#110158)
gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157)

Don't measure the CI performance: don't test the maximum elapsed
time. The check failed on a slow CI.
(cherry picked from commit c62b49ecc8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:47:41 +02:00
Victor Stinner
356de021d7
[3.12] gh-109047: concurrent.futures catches RuntimeError (#109810) (#110126)
gh-109047: concurrent.futures catches PythonFinalizationError (#109810)

concurrent.futures: The *executor manager thread* now catches
exceptions when adding an item to the *call queue*. During Python
finalization, creating a new thread can now raise RuntimeError. Catch
the exception and call terminate_broken() in this case.

Add test_python_finalization_error() to test_concurrent_futures.

concurrent.futures._ExecutorManagerThread changes:

* terminate_broken() no longer calls shutdown_workers() since the
  call queue is no longer working anymore (read and write ends of
  the queue pipe are closed).
* terminate_broken() now terminates child processes, not only
  wait until they complete.
* _ExecutorManagerThread.terminate_broken() now holds shutdown_lock
  to prevent race conditons with ProcessPoolExecutor.submit().

multiprocessing.Queue changes:

* Add _terminate_broken() method.
* _start_thread() sets _thread to None on exception to prevent
  leaking "dangling threads" even if the thread was not started
  yet.

(cherry picked from commit 6351842121)
2023-10-02 17:47:10 +02:00
Miss Islington (bot)
41eb0c7286
[3.12] gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102) (#110106)
gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102)
(cherry picked from commit 9c73a9acec)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:46:45 +02:00
Miss Islington (bot)
a2074911ba
[3.12] gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037) (#110064)
gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037)

On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c60c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:44:26 +02:00
Miss Islington (bot)
aaa8bf18c6
[3.12] gh-109960: Remove test_pty timeout of 10 seconds (GH-110058) (#110060)
gh-109960: Remove test_pty timeout of 10 seconds (GH-110058)

In 2003, test_pty got a hardcoded timeout of 10 seconds to prevent
hanging on AIX & HPUX "if run after test_openpty":
commit 7d8145268e. Since 2003, test_pty
was no longer reported to hang on AIX. But today, the test can fail
simply because a CI is busy running other tests in parallel.
The timeout of 10 seconds is no longer needed, just remove it.
Moreover, regrtest now has multiple built-in generic timeout
mecanisms.
(cherry picked from commit 5fdcea7440)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:43:38 +02:00
Miss Islington (bot)
2b96102f29
[3.12] gh-109889: fix compiler's redundant NOP detection to look past NOPs with no lineno when looking for the next instruction's lineno (GH-109987) (#110048)
gh-109889: fix compiler's redundant NOP detection to look past NOPs with no lineno when looking for the next instruction's lineno (GH-109987)
(cherry picked from commit f580edcc6a)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-10-02 17:43:16 +02:00
Davide Rizzo
c794103417
[3.12] gh-110038: KqueueSelector must count all read/write events (GH-110039) (#110043)
[3.12] gh-110038: KqueueSelector must count all read/write events (GH-110039).
(cherry picked from commit b14f0ab51c)
2023-10-02 17:42:55 +02:00
Miss Islington (bot)
4bdcb99469
[3.12] gh-110033: Fix signal test_interprocess_signal() (GH-110035) (#110040)
gh-110033: Fix signal test_interprocess_signal() (GH-110035)

Fix test_interprocess_signal() of test_signal. Make sure that the
subprocess.Popen object is deleted before the test raising an
exception in a signal handler. Otherwise, Popen.__del__() can get the
exception which is logged as "Exception ignored in: ...." and the
test fails.
(cherry picked from commit 7e0fbf5175)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:42:40 +02:00
Miss Islington (bot)
9cf6d89165
[3.12] gh-109594: Fix concurrent.futures test_timeout() (GH-110018) (#110021)
gh-109594: Fix concurrent.futures test_timeout() (GH-110018)

Fix test_timeout() of test_concurrent_futures.test_wait. Remove the
future which may or may not complete depending if it takes longer
than the timeout ot not. Keep the second future which does not
complete before wait(). Make also the test faster: 0.5 second instead
of 6 seconds, so remove @support.requires_resource('walltime')
decorator.
(cherry picked from commit 9be283e5e1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:42:03 +02:00
Jelle Zijlstra
9be6a11199
[3.12] gh-109818: reprlib.recursive_repr copies __type_params__ (… (#109999)
[3.12] gh-109818: `reprlib.recursive_repr` copies `__type_params__` (GH-109819).
(cherry picked from commit f65f9e80fe)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:41:26 +02:00
Miss Islington (bot)
73ec1e7c21
[3.12] gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949) (#109952)
gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949)

as_completed() uses a timeout of 100 ms instead of 10 ms. Windows
monotonic clock resolution is around 15.6 ms.
(cherry picked from commit b1aebf1e65)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:40:16 +02:00
Victor Stinner
1fc25a389c
[3.12] gh-109615: Fix test_tools.test_freeze SRCDIR (#109935) (#109950)
gh-109615: Fix test_tools.test_freeze SRCDIR (#109935)

Fix copy_source_tree() function of test_tools.test_freeze:

* Don't copy SRC_DIR/build/ anymore. This directory is modified by
  other tests running in parallel.
* Add test.support.copy_python_src_ignore().
* Use sysconfig to get the source directory.
* Use sysconfig.get_config_var() to get CONFIG_ARGS variable.

(cherry picked from commit 1512d6c6ee)
2023-10-02 17:40:02 +02:00
Miss Islington (bot)
1f622004c5
[3.12] gh-109845: Make test_ftplib more stable under load (GH-109912) (#109919)
gh-109845: Make test_ftplib more stable under load (GH-109912)

recv() can return partial data cut in the middle of a multibyte
character. Test raw binary data instead of data incorrectly decoded by parts.
(cherry picked from commit 2ef2fffe3b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 17:38:07 +02:00
Miss Islington (bot)
b723b8a13d
[3.12] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629) (#109898)
gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629)

---------

(cherry picked from commit 0eb98837b6)

Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-10-02 17:37:40 +02:00
Miss Islington (bot)
84f9da9ab5
[3.12] gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887) (#109892)
gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887)

test_error_at_task_unpickle() and
test_error_during_result_unpickle_in_result_handler() now restore
sys.stderr which is overriden by _raise_error_ignore_stderr().
(cherry picked from commit 2897142d2e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:37:25 +02:00
Miss Islington (bot)
d09a3145b5
[3.12] gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835) (#109855)
gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835)

Skip test_is_alive_after_fork() of test_threading if Python is built
with Address Sanitizer (ASAN).
(cherry picked from commit bc06743533)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:36:04 +02:00
Miss Islington (bot)
e25bc38ebb
[3.12] gh-109702: Increase concurrent_futures deadlock timeout (GH-109703) (#109705)
gh-109702: Increase concurrent_futures deadlock timeout (GH-109703)

Replace SHORT_TIMEOUT with LONG_TIMEOUT in test_deadlock of
test_concurrent_futures.
(cherry picked from commit 1eb1b45183)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:35:36 +02:00
Miss Islington (bot)
8c5fd2105c
[3.12] gh-109625: Move _ready_to_import() from test_import to support.import_helper (GH-109626) (#109640)
gh-109625: Move _ready_to_import() from test_import to support.import_helper (GH-109626)
(cherry picked from commit 115c49ad5a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:35:03 +02:00
Miss Islington (bot)
150bd302bb
[3.12] gh-109833: Fix asyncio test_wait_for() (GH-109834) (#109837)
gh-109833: Fix asyncio test_wait_for() (GH-109834)

Expect the test to be "short" but don't measure the exact performance
of the CI. SHORT_TIMEOUT is about 30 seconds whereas the cancelled
coroutine takes around 1 hour.
(cherry picked from commit f29bc9c9a0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:24:51 +02:00
elfstrom
c2cadb0ec2
[3.12] gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock (GH-108513) (#109784)
This fixes issue GH-105829, https://github.com/python/cpython/issues/105829
(cherry picked from commit 405b06375a)
2023-10-02 17:24:19 +02:00
Miss Islington (bot)
6a6bea3ee8
[3.12] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707) (#109762)
gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707)

Don't check order, queue items can be written in any order.
(cherry picked from commit b03a791497)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:22:16 +02:00
Pablo Galindo Salgado
f6cb2e4815
[3.12] gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect soft keywords (GH-109606). (#109752)
(cherry picked from commit b28ffaa193)
2023-10-02 17:22:07 +02:00
Miss Islington (bot)
c7cbd82e62
[3.12] gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710) (#109731)
gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
(cherry picked from commit cbbdf2c144)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:21:51 +02:00
Miss Islington (bot)
551aa6ab94
[3.12] gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588) (#109725)
gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)
(cherry picked from commit 8fc071345b)

Co-authored-by: EliseevEgor <egor.eliseev@jetbrains.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:18:41 +02:00
Victor Stinner
84ef145d85
[3.12] gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697) (#109698)
gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697)

On FreeBSD, regular users cannot set the sticky bit. Skip the test if
chmod() fails with EFTYPE error.

(cherry picked from commit 26e06ad617)
2023-10-02 17:16:25 +02:00
Miss Islington (bot)
05b139b599
[3.12] gh-109582: test_fork_signal_handling should wait for event (GH-109605) (#109695)
gh-109582: test_fork_signal_handling should wait for event (GH-109605)

Sometimes the child_handled event was missing because either
the child quits before it gets a chance to handle the signal,
or the parent asserts before the event notification is
delivered via IPC.  Synchronize explicitly to avoid this.
(cherry picked from commit 608c1f3083)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2023-10-02 17:14:30 +02:00
Victor Stinner
5baa8af8da
[3.12] gh-108303: Move test_future into its own test_future_stmt subdir (#109368) (#109679)
gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)

(cherry picked from commit 82505dc351)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:12:54 +02:00