Repository navigation
test_embed.test_init_pyvenv_cfg() fails #128690
Copy link
Copy link
Closed
Labels
deferred-blockertestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Trying to build Python from main branch and running tests on MacOS 15.2 fails on test_embed.test_init_pyvenv_cfg.
./configure && make -j && ./python.exe -m test test_embedFAIL: test_init_pyvenv_cfg (test.test_embed.InitConfigTests.test_init_pyvenv_cfg)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/yyanchii/Desktop/cpython/Lib/test/test_embed.py", line 1671, in test_init_pyvenv_cfg
self.check_all_configs("test_init_compat_config", config,
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api=API_COMPAT, env=env,
^^^^^^^^^^^^^^^^^^^^^^^^
ignore_stderr=True, cwd=tmpdir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yyanchii/Desktop/cpython/Lib/test/test_embed.py", line 939, in check_all_configs
self.check_config(configs, expected_config)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yyanchii/Desktop/cpython/Lib/test/test_embed.py", line 865, in check_config
self.assertEqual(config, expected)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
AssertionError: {'argv': [''], 'base_exec_prefix': '/usr/lo[2028 chars]None} != {'_config_init': 1, 'isolated': False, 'use[2128 chars]alse}
{'_config_init': 1,
'_init_main': True,
'_install_importlib': True,
'argv': [''],
- 'base_exec_prefix': '/usr/local',
+ 'base_exec_prefix': '/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_o9bmpp_',
'base_executable': '/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_o9bmpp_/_testembed',
'base_prefix': '/usr/local',
'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': '/private/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_7n79vly',
'executable': '/private/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_7n79vly/_testembed',
'faulthandler': False,
'hash_seed': 0,
'home': None,
'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',
'/Users/yyanchii/Desktop/cpython/Lib',
'/Users/yyanchii/Desktop/cpython/build/lib.macosx-15.2-arm64-3.14',
'/usr/local/lib/python314.zip',
'/usr/local/lib/python3.14',
- '/usr/local/lib/python3.14/lib-dynload'],
+ '/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_o9bmpp_/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': '/private/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_7n79vly',
'program_name': './_testembed',
'pycache_prefix': None,
'pythonpath_env': '/usr/local/lib/python314.zip:/Users/yyanchii/Desktop/cpython/Lib:/Users/yyanchii/Desktop/cpython/build/lib.macosx-15.2-arm64-3.14',
'quiet': False,
'run_command': None,
'run_filename': None,
'run_module': None,
'run_presite': None,
'safe_path': False,
'show_ref_count': False,
'site_import': True,
'skip_source_first_line': False,
'sys_path_0': None,
'tracemalloc': 0,
'use_environment': True,
'use_frozen_modules': False,
'use_hash_seed': False,
'use_system_logger': False,
'user_site_directory': True,
'verbose': 0,
'warn_default_encoding': False,
'warnoptions': [],
'write_bytecode': True,
'xoptions': {}}
----------------------------------------------------------------------
Ran 82 tests in 5.051s
FAILED (failures=1, skipped=3)
test test_embed failed
test_embed failed (1 failure)
== Tests result: FAILURE ==
1 test failed:
test_embed
Total duration: 5.1 sec
Total tests: run=82 failures=1 skipped=3
Total test files: run=1/1 failed=1
Result: FAILUREAfter bisecting found out 34e840f9ddd commit to be the reason. cc @FFY00
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
deferred-blockertestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Activity
FFY00 commentedon Jan 11, 2025
The test is mocking an installation, and we now return more accurate information since the prefix comes from the runtime library instead of
pyvenv.cfg, so we can just skip the test when running with a shared library, sincepyvenv.cfgis no longer relevant here.pythonGH-128690: skip test_init_pyvenv_cfg on shared builds
pythongh-128690: temporarily do not use test_embed in PGO profile builds
ned-deily commentedon Jan 13, 2025
FWIW, this failure apparently can also arise in non-shared builds and can have a fatal impact on builds where it does fail since
test_embedis one of the tests run for PGO profiling with--enable-optimizations. See #128771 for more details.gh-128690: temporarily do not use test_embed in PGO profile builds (#…
ned-deily commentedon Jan 13, 2025
With release manager approval, #128771 was merged to temporarily avoid using
test_embedin the PGO profile builds which are used in some release builds. I'm marking this as adeferred blockerso we don't forget to resolve the main issue and restore use oftest_embed.[-]`test_embed.test_init_pyvenv_cfg` fails[/-][+][macOS] `test_embed.test_init_pyvenv_cfg` fails[/+]vstinner commentedon Jan 21, 2025
Is it possible to reproduce this issue on operating systems other than macOS? Or is the issue specific to macOS?
befeleme commentedon Jan 21, 2025
This test fails also on Fedora Linux
[-][macOS] `test_embed.test_init_pyvenv_cfg` fails[/-][+]`test_embed.test_init_pyvenv_cfg()` fails[/+]vstinner commentedon Jan 21, 2025
Oh ok, I managed to reproduce the bug on Fedora 41 using commands:
pythongh-128690: Update test_embed for sysconfig exec_prefix change
pythongh-128690: Update test_embed for getpath.py exec_prefix change
vstinner commentedon Jan 21, 2025
I wrote PR #129137 to update test_embed for the
getpath.pyexec_prefix change.gh-128690: Update test_embed for getpath.py exec_prefix change (#129137)
vstinner commentedon Jan 23, 2025
I updated test_embed with the change b23b27b.