Commit graph

415 commits

Author SHA1 Message Date
Cody Maloney
6ff62ac4fb
gh-140082: Forward colorizing from libregrtest to unittest (#140083)
libregrtest redirects test output to a file as part of its operation.
When `unittest` checks to see if it should colorize with
`isatty(sys.stdout)` that fails resulting in no colorizing of the
unittest output.

Update `libregrtest` to set `FORCE_COLOR=1` when redirecting test output
so that unittest will do color printing.

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-29 13:33:44 +01:00
Barry Warsaw
b3c713a0af
gh-140482: Preserve and restore stty echo as a test environment (#140519)
gh-140482: Restore `stty echo` as a test environment
2025-10-24 11:07:08 -07:00
Malcolm Smith
a9b0506d8d
gh-137242: Allow Android testbed to take all Python command-line options (#138805)
Modifies the Android test runner to ensure that all valid Python command line
options are preserved when running the test suite.
2025-10-06 13:19:48 +08:00
Victor Stinner
0158890005
gh-139322: Create test_os package (#139453)
* Move test_posix.py and test_os.py to Lib/test/test_os/.
* Split Windows specific test cases to a new test_windows.py file.
2025-10-01 16:42:45 +02:00
Victor Stinner
dd683f8f34
gh-139208: Fix regrtest --fast-ci --verbose (#139240)
Don't ignore the --verbose option anymore.
2025-09-23 16:09:01 +02:00
Alex Waygood
293b05c09b
gh-118803: Make ByteString deprecations louder; remove ByteString from typing.__all__ and collections.abc.__all__ (#139127) 2025-09-18 18:58:16 +00:00
Victor Stinner
01895d233b
gh-137242: Add a --no-randomize option, and use it in Android CI (#138649)
Adds a --no-randomize option to the CI runner, so that randomisation can be easily
disabled for --fast-ci and --slow-ci configurations on single-threaded testing platforms
like Android, iOS, and Emscripten.

---------

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-09-09 06:45:42 +08:00
Cody Maloney
974532e758
gh-138013: Move I/O tests to test_io (#138365)
Centralize `io` tests into the `test_io` module so they are easier to
find and work on. This will make it easier to split `test_general` which
takes 30+ seconds in a debug build on my machine.

This renames `test_bufio` to be `test_bufferedio` so that it matches
the implementation file name (`bufferedio.c`).

Validation performed:
Tests are run in parallel after change:

```bash
./python.exe -m test test_io  -uall,largefile,extralargefile -M12G -j8
```

Docstring reformat in `test_io/__init__.py` looks reasonable:

```python
>>> import test.test_io
>>> help(test.test_io)
```

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 11:37:06 +02:00
Serhiy Storchaka
1612dcbafe
gh-137341: Remove more word duplications (GH-137342) 2025-08-03 19:41:12 +03:00
Jelle Zijlstra
797abd1f7f
gh-134657: Remove newly added private names from asyncio.__all__ (#134665) 2025-07-09 13:25:46 +05:30
Kumar Aditya
51934000ba
gh-117657: enable test_capi under TSAN (#136269) 2025-07-08 13:05:24 +05:30
Victor Stinner
15c6d63fe6
gh-135494: Fix python -m test --pgo -x test_re (#135713)
Fix regrtest to support excluding tests from --pgo tests.
2025-06-24 12:21:35 +02:00
Kumar Aditya
b14986c914
gh-130605: reenable test_concurrent_futures tests under TSAN (#135790) 2025-06-21 22:03:17 +05:30
PuQing
5b3a826888
gh-135489: Show verbose output for failing tests during PGO profiling step with --enable-optimizations (#135512) 2025-06-17 01:06:48 -04:00
Victor Stinner
3d396ab759
gh-135124: Change stdout errors in regrtest worker process (#135138)
Set sys.stdout encoder error handler to backslashreplace in regrtest
workers to avoid UnicodeEncodeError when printing a traceback
or any other non-encodable character.

Move the code from the Regrtest class to setup_process().

Call setup_process() earlier, before displaying regrtest headers.
2025-06-05 11:17:03 +02:00
AN Long
4274b47156
gh-133519: Add console to resources in libregrtest (#133520)
Add console to resources in libregrtest
2025-05-09 18:30:13 +02:00
Brandt Bucher
b1aa515bd6
GH-133231: Add JIT utilities in sys._jit (GH-133233) 2025-05-05 15:25:22 -07:00
sobolevn
8467026ed6
Bump mypy to 1.15 (#133405) 2025-05-05 13:29:48 +03:00
Kumar Aditya
8516343d3a
gh-127945: add test_ctypes to free-threading TSAN CI (#132727) 2025-04-21 22:56:56 +05:30
Łukasz Langa
a594008d9e
gh-132678: Add --prioritize to regrtest (GH-132679)
This is an option that allows the user to specify, which selected tests should
execute first, even if the order is otherwise randomized.  This is particularly
useful for tests that run the longest.
2025-04-18 15:56:44 +02:00
Kumar Aditya
9752661491
gh-128002: run all asyncio tests with tsan CI (#131797) 2025-03-28 19:30:36 +05:30
Thomas Grainger
8a00c9a4d2
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings, and internal test warnings that are now logged (#128973)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-27 21:06:52 +02:00
Victor Stinner
73ab9e2ede
gh-131152: Remove unused imports from tests (#131153) 2025-03-13 10:55:23 +01:00
Pablo Galindo Salgado
ebc24d54bc
gh-117174: Fix reference leak and gdb tests (#131095) 2025-03-11 23:17:58 +00:00
Kumar Aditya
24070492cf
gh-128002: add test_asyncio.test_free_threading to tsan tests (#131106) 2025-03-12 01:33:44 +05:30
Sam Gross
959f43315e
gh-130605: Temporarily disable test_concurrent_futures in TSAN CI job (gh-130606)
There are a number of data races in the default build without
suppressions that are exposed by this test. Disable the test for now
under TSAN until we have suppressions or fix the data races.
2025-02-26 21:36:53 +00:00
Sam Gross
3774d9f7b5
gh-129824: Temporarily skip InterpreterPoolMixin tests under TSAN (gh-129826)
There are multiple data races reported when running the
InterpreterPoolMixin tests, but it's still useful to run the other
test_concurrent_futures tests under TSAN.

Add test_concurrent_futures to the TSAN test suite.
2025-02-25 10:33:04 -05:00
Victor Stinner
f1b81c408f
gh-129363: Change regrtest sequential mode output (#129476)
First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-21 14:55:32 +01:00
Sam Gross
1a8082a4bf
gh-117657: Add test_thread_local_bytecode to TSAN tests (gh-129753)
Skip `test_no_copies_if_tlbc_disabled` when run under TSAN for now
due to a data race on the adaptive counter (see gh-129752).
2025-02-11 16:54:32 -05:00
Sam Gross
f151d27159
gh-117657: Enable test_opcache under TSAN (GH-129831)
Fix a few thread-safety bugs to enable test_opcache when run with TSAN:

 * Use relaxed atomics when clearing `ht->_spec_cache.getitem`
   (gh-115999)
 * Add temporary suppression for type slot modifications (gh-127266)
 * Use atomic load when reading `*dictptr`
2025-02-11 16:53:08 -05:00
Sam Gross
3b548adc76
gh-129980: Include test name in TSAN filename in multiprocess test runner (GH-129981) 2025-02-11 12:09:43 -05:00
Sam Gross
c1f352bf08
gh-128657: Run test_hashlib with --parallel-threads (GH-129833)
* gh-128657: Run test_hashlib with `--parallel-threads`

This catches the race in `py_digest_by_name` that is fixed separately
in gh-128886.

* Adjust assertion order
2025-02-08 12:12:21 -08:00
Sam Gross
a191d6f78e
gh-117657: Include all of test_free_threading in TSAN tests (#129749) 2025-02-07 00:37:05 +01:00
Sam Gross
555dc50c81
gh-129694: Add --parallel-threads TSAN job to CI (gh-129696)
For now, this just adds a single test suite to the TSAN CI to be run
with `--parallel-threads`.
2025-02-06 15:19:00 +00:00
Sam Gross
e5f10a7414
gh-127933: Add option to run regression tests in parallel (gh-128003)
This adds a new command line argument, `--parallel-threads` to the
regression test runner to allow it to run individual tests in multiple
threads in parallel in order to find multithreading bugs.

Some tests pass when run with `--parallel-threads`, but there's still
more work before the entire suite passes.
2025-02-04 17:44:59 -05:00
Hugo van Kemenade
6f167d7134
gh-128595: Default to stdout isatty for colour detection instead of stderr (#128498)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-20 12:52:42 +02:00
Hugo van Kemenade
76856ae165
Revert "gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings (#128726)" (#128936) 2025-01-17 15:16:10 +02:00
Thomas Grainger
7807b40730
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings (#128726)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Brett Cannon <brett@python.org>
2025-01-17 13:39:16 +02:00
Ned Deily
b00e1254fc
gh-128690: temporarily do not use test_embed in PGO profile builds (#128771)
Temporarily do not use test_embed in PGO profile builds until the problem with test_init_pyvenv_cfg failing in some configurations is resolved.
2025-01-13 04:02:18 -05:00
Kumar Aditya
5892853fb7
gh-127949: deprecate asyncio.set_event_loop_policy (#128024)
First step towards deprecating the asyncio policy system.
This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
2024-12-18 11:35:29 +05:30
Hood Chatham
1183e4ce2f
gh-127146: Emscripten clean up test suite (#127984)
Removed test skips that are no longer required as a result of Emscripten updates.
2024-12-17 07:48:23 +00:00
Skip Montanaro
050d59bd17
add help blurb for "extralargefile" (#127710) 2024-12-10 09:17:25 +01:00
Hugo van Kemenade
212448b162
gh-127718: Add colour to test.regrtest output (#127719) 2024-12-10 09:44:15 +02:00
Daniele Parmeggiani
979bf2489d
gh-117657: TSAN Fix races in PyMember_Get and PyMember_Set for C extensions (GH-123211) 2024-12-03 09:41:53 -05:00
Mark Shannon
a8dd821d5b
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-127110)
* Mark almost all reachable objects before doing collection phase

* Add stats for objects marked

* Visit new frames before each increment

* Update docs

* Clearer calculation of work to do.
2024-12-02 10:12:17 +00:00
Victor Stinner
0cb20177d6
gh-109413: Fix libregrtest get_running() (#127153)
Skip threads which are not running.
2024-11-22 16:56:03 +01:00
sobolevn
824afbf548
gh-109413: Enable mypy's disallow_any_generics setting when checking libregrtest (#127033) 2024-11-19 22:41:59 +03:00
sobolevn
a1d9c8aa80
gh-109413: Enable strict_optional = true for libregrtest/run_workers (#126855)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-11-18 17:23:43 +03:00
sobolevn
12ca7e622f
gh-109413: Enable strict_optional for libregrtest/main.py (#126394) 2024-11-13 22:29:28 +03:00
sobolevn
bfc1d2504c
gh-109413: Add more type hints to libregrtest (#126352) 2024-11-04 13:15:57 +03:00