Skip to content

gh-161430: Omit tests expected to be skipped in regrtest - #161432

Draft
vstinner wants to merge 19 commits into
python:mainfrom
vstinner:regrtest_expected_skip
Draft

vstinner wants to merge 19 commits into
python:mainfrom
vstinner:regrtest_expected_skip

Conversation

@vstinner

@vstinner vstinner commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

@vstinner

vstinner commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Current status.

Windows:

3 tests skipped:
    test_perf_profiler test_perfmaps test_samply_profiler

macOS:

6 tests skipped:
    test.test_gdb.test_backtrace test.test_gdb.test_cfunction
    test.test_gdb.test_cfunction_full test.test_gdb.test_jit
    test.test_gdb.test_misc test.test_gdb.test_pretty_print

Ubuntu:

1 test skipped:
    test_interpreters

@vstinner

vstinner commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Emscripten:

200 tests expected to be skipped (not listed)

9 tests skipped:
    test.test_gdb.test_backtrace test.test_gdb.test_cfunction
    test.test_gdb.test_cfunction_full test.test_gdb.test_jit
    test.test_gdb.test_misc test.test_gdb.test_pretty_print
    test__interpreters test_perfmaps test_pty

@vstinner

vstinner commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

iOS:

  123 tests expected to be skipped (not listed)
  
  10 tests skipped:
      test.test_asyncio.test_subprocess test.test_gdb.test_backtrace
      test.test_gdb.test_cfunction test.test_gdb.test_cfunction_full
      test.test_gdb.test_jit test.test_gdb.test_misc
      test.test_gdb.test_pretty_print test_asdl_parser test_perfmaps
      test_pty

@vstinner

vstinner commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Update.

Windows / Build and test (x64, switch-case) and Windows (free-threading) / Build and test (x64, switch-case):

52 tests expected to be skipped (not listed)

1 test skipped:
    test_xxlimited

macOS: 85 tests expected to be skipped (not listed)

macOS (free-threading) / build and test (macos-26): 25 tests expected to be skipped (not listed)

Ubuntu / build and test (ubuntu-26.04): 76 tests expected to be skipped (not listed)

Android (x86_64): 130 tests expected to be skipped (not listed)

iOS: 132 tests expected to be skipped (not listed)

Emscripten: 209 tests expected to be skipped (not listed)

WASI:232 tests expected to be skipped (not listed)

TSan: 63 tests expected to be skipped (not listed)

ASan:

75 tests expected to be skipped (not listed)

27 tests skipped:
    test.test_asyncio.test_subprocess
    test.test_concurrent_futures.test_as_completed
    test.test_concurrent_futures.test_deadlock
    test.test_concurrent_futures.test_future
    test.test_concurrent_futures.test_init
    test.test_concurrent_futures.test_interpreter_pool
    test.test_concurrent_futures.test_process_pool
    test.test_concurrent_futures.test_shutdown
    test.test_concurrent_futures.test_thread_pool
    test.test_concurrent_futures.test_wait
    test.test_multiprocessing_fork.test_manager
    test.test_multiprocessing_fork.test_misc
    test.test_multiprocessing_fork.test_processes
    test.test_multiprocessing_fork.test_threads
    test.test_multiprocessing_forkserver.test_manager
    test.test_multiprocessing_forkserver.test_misc
    test.test_multiprocessing_forkserver.test_processes
    test.test_multiprocessing_forkserver.test_threads
    test.test_multiprocessing_spawn.test_manager
    test.test_multiprocessing_spawn.test_misc
    test.test_multiprocessing_spawn.test_processes
    test.test_multiprocessing_spawn.test_threads test_idle
    test_perf_profiler test_samply_profiler test_tkinter test_ttk

UBSan: 75 tests expected to be skipped (not listed)

MSan:

88 tests expected to be skipped (not listed)

18 tests skipped:
    test.test_concurrent_futures.test_as_completed
    test.test_concurrent_futures.test_deadlock
    test.test_concurrent_futures.test_future
    test.test_concurrent_futures.test_init
    test.test_concurrent_futures.test_interpreter_pool
    test.test_concurrent_futures.test_process_pool
    test.test_concurrent_futures.test_shutdown
    test.test_concurrent_futures.test_thread_pool
    test.test_concurrent_futures.test_wait test_bz2 test_ctypes
    test_dbm_sqlite3 test_gzip test_perf_profiler test_samply_profiler
    test_sqlite3 test_stable_abi_ctypes test_zlib

I didn't note tests skipped because of denied resources, such as 3 tests skipped (resource denied): test_peg_generator test_xpickle test_zipfile64 on Ubuntu.

@vstinner
vstinner marked this pull request as ready for review November 5, 2026 22:04
@vstinner

vstinner commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@cmaloney: Ok, the PR is now ready for review :-)

Lib/test/libregrtest/skipped.py implements multiple different rulesets / heuristics to check if a test is expected to be skipped or not. The rulset is now complete so that there is no more "skipped" tests, only "tests expected to be skipped (not listed)".

The question is now which rulesets/heuristics are a good thing and which ones are a bad thing :-)

I think that the following rules are safe:

  • support.MS_WINDOWS
  • support.Py_GIL_DISABLED
  • sys.platform
  • IS_WASI: set from _PYTHON_HOST_PLATFORM environment variable, needed to filter properly tests on WASI

Safe rules which test sys.platform in practice:

  • support.is_android
  • support.is_apple
  • support.is_emscripten
  • support.has_socket_support
  • support.has_subprocess_support
  • support.is_wasm32
  • NEED_WORKING_THREADING: IS_WASI and threading_helper.can_start_thread check sys.platform

It should be ok:

  • support.has_fork_support: check sys.platform, but check also hasattr(os, "fork"). It should be ok to test hasattr(os, "fork").
  • sysconfig.get_config_var('WITH_DTRACE') (./configure --with-dtrace) check for test_dtrace
  • sysconfig.is_python_build() check for test_asdl_parser: skip if Python is installed. The test says: "test irrelevant for an installed Python".
  • support.supports_perf_trampoline_profiling() for test_perf_profiler, test_perfmaps and test_samply_profiler: check PY_HAVE_PERF_TRAMPOLINE macro which is only set on selected platforms+architectures by configure. So in practice, it checks the platform + architecture.

In the grey area, I'm not sure:

  • Test directly hasattr(os, function_name): maybe it should be replaced with a test on sys.platform. Tested functions: startfile() (Windows only), openpty(), wait3() and wait4() (not available on Windows).
  • sys.is_remote_debug_enabled(): maybe it should be replaced with a test on sys.platform + platform.architecture(). We mostly care about Py_SUPPORTS_REMOTE_DEBUG macro. If ./configure --without-remote-debug is used, the tests should be reported as skipped. Same if PYTHON_DISABLE_REMOTE_DEBUG env var or -X disable-remote-debug command line option is used.
  • shutil.which('gdb') for test_gdb: Should we complain that gdb is not installed, so complain if test_gdb tests are skipped?
  • SELECT_TESTS: is it ok to check hasattr(select, name)? devpoll() is available on Solaris, kqueue on FreeBSD and macOS, epoll() on Linux, select() on non-Windows platforms. But having exhaustive list of supported and unsupported platforms is more tricky to write.

Bad idea?

  • NEED_MODULES is most risky check. If Python fails to build an extension module (ex: ctypes), NEED_MODULES ignores silently that the test is skipped because of the build error. Maybe it should be replaced with a test on sys.platform. For example, fcntl cannot be built on Windows, so it's safe to expect test_fcntl to be skipped on Windows.

* Replace hasattr(os, name) check for sys.platform check.
* List disabled extensions on Apple mobile and on Emscripten
@vstinner
vstinner marked this pull request as draft November 5, 2026 23:08
@vstinner

vstinner commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Sorry, I changed my mind and marked again the PR as a draft. I'm making more changes to address #161432 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant