Skip to content

test_embed and test_ssl failing on linux 6.12.13 #131579

Description

@abhi-jha

OS : Linux kali 6.12.13-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.12.13-1kali1 (2025-02-11) x86_64 GNU/Linux

Build python

./configure  --with-pydebug --with-trace-refs

make

./python -m venv .venv

source .venv/bin/activate

make test #test_ssl and test_embed fails

python -m test -v test_embed #fails

python -m test -v test_ssl #fails

Failure for test_ssl in IDE for comparison.

Image

Is there more to python setup for the tests to succeed? The SSL test seems to be comparing default(7) to actual(8) options hence the mismatch.

I don't know why the test_embed is failing.

Error logs:

0:01:18 load avg: 7.17 [1/2/1] test_ssl failed (1 failure)
Re-running test_ssl in verbose mode (matching: test_options)
test_ssl: testing with 'OpenSSL 3.4.1 11 Feb 2025' (3, 4, 0, 1, 0)
          under 'Linux-6.12.13-amd64-x86_64-with-glibc2.40'
          HAS_SNI = True
          OP_ALL = 0x80000050
          OP_NO_TLSv1_1 = 0x10000000
test_options (test.test_ssl.BasicSocketTests.test_options) ... ok
test_options (test.test_ssl.ContextTests.test_options) ... FAIL
test_options (test.test_ssl.TestEnumerations.test_options) ... ok

======================================================================
FAIL: test_options (test.test_ssl.ContextTests.test_options)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kali/Desktop/GIT/cpython/Lib/test/test_ssl.py", line 970, in test_options
    self.assertEqual(default, ctx.options)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
AssertionError: <Opti[52 chars]CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|OP_ALL: 2186412112> != <Opti[52 chars]CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|OP_ALL|262144: 2186674256>

----------------------------------------------------------------------
Ran 3 tests in 0.004s

FAILED (failures=1)
test test_ssl failed
0:01:18 load avg: 7.17 [2/2/2] test_embed failed (1 failure)
Re-running test_embed in verbose mode (matching: test_init_setpythonhome)
test_init_setpythonhome (test.test_embed.InitConfigTests.test_init_setpythonhome) ... FAIL

======================================================================
FAIL: test_init_setpythonhome (test.test_embed.InitConfigTests.test_init_setpythonhome)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kali/Desktop/GIT/cpython/Lib/test/test_embed.py", line 1456, in test_init_setpythonhome
    self.check_all_configs("test_init_setpythonhome", config,
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           api=API_COMPAT, env=env)
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/Desktop/GIT/cpython/Lib/test/test_embed.py", line 948, in check_all_configs
    self.check_config(configs, expected_config)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kali/Desktop/GIT/cpython/Lib/test/test_embed.py", line 874, in check_config
    self.assertEqual(config, expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
AssertionError: {'argv': [''], 'base_exec_prefix': '/home/k[2036 chars]None} != {'_config_init': 1, 'isolated': False, 'use[2022 chars]alse}
  {'_config_init': 1,
   '_init_main': True,
   '_install_importlib': True,
   'argv': [''],
   'base_exec_prefix': '/home/kali/Desktop/GIT/cpython',
   'base_executable': '/home/kali/Desktop/GIT/cpython/.venv1/bin/python3',
   'base_prefix': '/home/kali/Desktop/GIT/cpython',
   'buffered_stdio': True,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'code_debug_ranges': True,
   'configure_c_stdio': False,
   'cpu_count': -1,
   'dev_mode': False,
   'dump_refs': False,
   'dump_refs_file': None,
-  'exec_prefix': '/home/kali/Desktop/GIT/cpython/.venv1',
?                                                -------

+  'exec_prefix': '/home/kali/Desktop/GIT/cpython',
   'executable': '/home/kali/Desktop/GIT/cpython/.venv1/bin/python3',
   'faulthandler': False,
   'hash_seed': 0,
   'home': '/home/kali/Desktop/GIT/cpython',
   'import_time': False,
   'inspect': False,
   'install_signal_handlers': True,
   'int_max_str_digits': 4300,
   'interactive': False,
   'isolated': False,
   'malloc_stats': False,
   'module_search_paths': ['/usr/local/lib/python314.zip',
                           '/home/kali/Desktop/GIT/cpython/Lib',
                           '/home/kali/Desktop/GIT/cpython/build/lib.linux-x86_64-3.14',
                           '/home/kali/Desktop/GIT/cpython/lib/python314.zip',
                           '/home/kali/Desktop/GIT/cpython/lib/python3.14',
                           '/home/kali/Desktop/GIT/cpython/lib/python3.14/lib-dynload'],
   'module_search_paths_set': True,
   'optimization_level': 0,
   'orig_argv': [],
   'parse_argv': False,
   'parser_debug': False,
   'pathconfig_warnings': True,
   'perf_profiling': 0,
   'platlibdir': 'lib',
-  'prefix': '/home/kali/Desktop/GIT/cpython/.venv1',
?                                           -------

+  'prefix': '/home/kali/Desktop/GIT/cpython',
   'program_name': 'python3',
   'pycache_prefix': None,
   'pythonpath_env': '/usr/local/lib/python314.zip:/home/kali/Desktop/GIT/cpython/Lib:/home/kali/Desktop/GIT/cpython/build/lib.linux-x86_64-3.14',
   'quiet': False,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'safe_path': False,
   'show_ref_count': False,
   'site_import': True,
   'skip_source_first_line': False,
   'stdlib_dir': '/home/kali/Desktop/GIT/cpython/lib/python3.14',
   'sys_path_0': None,
   'tracemalloc': 0,
   'use_environment': True,
   'use_frozen_modules': True,
   'use_hash_seed': False,
   'user_site_directory': True,
   'verbose': 0,
   'warn_default_encoding': False,
   'warnoptions': [],
   'write_bytecode': True,
   'xoptions': {}}

----------------------------------------------------------------------
Ran 1 test in 0.041s

FAILED (failures=1)
test test_embed failed
2 tests failed again:
    test_embed test_ssl

== Tests result: FAILURE then FAILURE ==

Activity

  1. added
    testsTests in the Lib/test dir
    type-bugAn unexpected behavior, bug, or error
    on Mar 22, 2025
  2. vstinner commented on Mar 25, 2025

    @vstinner
    Member

    Which Python version did you try?

  3. abhi-jha commented on Mar 25, 2025

    @abhi-jha
    ContributorAuthor

    Python version : 3.14

    I compiled the source on main, created a venv with it and ran make test inside the virtual environment.

    Python 3.14.0a6+ (heads/master:49fb75c676, Mar 23 2025, 07:12:36) [GCC 14.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
  4. vstinner commented on Apr 2, 2025

    @vstinner
    Member

    I cannot reproduce the test_embed failure.

    $ git clean -fdx
    $ ./configure  --with-pydebug --with-trace-refs && make
    $ ./python -m venv .venv
    $ source .venv/bin/activate
    (.venv) $ python -m test -v test_embed #fails
    ...
    test_init_setpythonhome (test.test_embed.InitConfigTests.test_init_setpythonhome) ...
    skipped "'/home/vstinner/python/main/.venv/bin/Programs/_testembed' doesn't exist"
    ...
    
  5. vstinner commented on Apr 2, 2025

    @vstinner
    Member

    test_ssl: testing with 'OpenSSL 3.4.1 11 Feb 2025' (3, 4, 0, 1, 0)

    For test_ssl, I suppose that the test fails with the recent OpenSSL 3.4.

    I cannot reproduce the test_ssl failure with my OpenSSL 3.2.4 11 Feb 2025.

  6. vstinner commented on Apr 2, 2025

    @vstinner
    Member

    I don't know why the test_embed is failing.

    It's because your run the test in a virtual environment.

  7. abhi-jha commented on Apr 15, 2025

    @abhi-jha
    ContributorAuthor

    Isn't the venv mostly to set some environment variables so that it points to correct python version as well as installed packages?

    I compiled the source and created a venv out of it. Now everytime I compile the source the executable env is always pointing to the newly built binary which seems in line with what I expect.

    Do you recommend another way of testing it?

  8. vstinner commented on Apr 15, 2025

    @vstinner
    Member

    You don't need to create a virtual environment to run the Python test suite. Just run make test.

  9. vstinner commented on Dec 9, 2025

    @vstinner
    Member

    I close the issue since I cannot reproduce the failures on Fedora 43 (OpenSSL 3.5.4).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-SSLtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions