Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-93353: regrtest creates worker directory in the parent #93817

Closed
wants to merge 1 commit into from
Closed

gh-93353: regrtest creates worker directory in the parent #93817

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

regrtest now creates the working directory of the worker process in
the parent process.

Don't check for temporary files if Python is run on WASI: WASI
doesn't pass environment variables to the worker process.

regrtest now creates the working directory of the worker process in
the parent process.

Don't check for temporary files if Python is run on WASI: WASI
doesn't pass environment variables to the worker process.
@vstinner
Copy link
Member Author

vstinner commented Jun 15, 2022

Tests / Address sanitizer (pull_request) Failing after 12m

Oh, there are many issues:

1 test altered the execution environment:
    test_threading

8 re-run tests:
    test_asyncio test_cmd_line_script test_compileall test_embed
    test_logging test_socket test_socketserver test_urllib

Many tests failed with "OSError: AF_UNIX path too long": I created issue #93852 for that.

test_compileall, test_cmd_line_script and test_urllib failed with UnicodeEncodeError:

======================================================================
ERROR: test_include_on_stdin (test.test_compileall.CommandLineTestsNoSourceEpoch.test_include_on_stdin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_py_compile.py", line 22, in wrapper
    return fxn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/test/test_compileall.py", line 755, in test_include_on_stdin
    p.stdin.write((f3+os.linesep).encode('ascii'))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 58: ordinal not in range(128)

======================================================================
ERROR: test_include_on_stdin (test.test_compileall.CommandLineTestsWithSourceEpoch.test_include_on_stdin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_py_compile.py", line 32, in wrapper
    return fxn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/test/test_compileall.py", line 755, in test_include_on_stdin
    p.stdin.write((f3+os.linesep).encode('ascii'))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 58: ordinal not in range(128)

======================================================================
ERROR: test_error (test.test_compileall.EncodingTest.test_error)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_compileall.py", line 458, in test_error
    compileall.compile_dir(self.directory)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/compileall.py", line 116, in compile_dir
    for file in files:
    ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/compileall.py", line 29, in _walk_dir
    print('Listing {!r}...'.format(dir))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 67: ordinal not in range(128)

======================================================================
ERROR: test_file_notexists (test.test_urllib.urlopen_HttpTests.test_file_notexists)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/urllib/parse.py", line 1004, in _to_bytes
    url = url.encode("ASCII").decode()
          ^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 75: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_urllib.py", line 535, in test_file_notexists
    with urlopen(tmp_fileurl) as fobj:
         ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/test/test_urllib.py", line 54, in urlopen
    return opener.open(url)
           ^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/urllib/request.py", line 1760, in open
    fullurl = unwrap(_to_bytes(fullurl))
                     ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/urllib/parse.py", line 1006, in _to_bytes
    raise UnicodeError("URL " + repr(url) +
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeError: URL 'file://localhost//home/runner/work/cpython/cpython/build/test_python_13115_æ/test_python_worker_61001_æ_tmpdir/tmpk_ljcax1' contains non-ASCII characters

======================================================================
ERROR: test_pep_409_verbiage (test.test_cmd_line_script.CmdLineTest.test_pep_409_verbiage)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_cmd_line_script.py", line 551, in test_pep_409_verbiage
    text = stderr.decode('ascii').split('\n')
           ^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 101: ordinal not in range(128)

======================================================================
ERROR: test_syntaxerror_indented_caret_position (test.test_cmd_line_script.CmdLineTest.test_syntaxerror_indented_caret_position)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_cmd_line_script.py", line 616, in test_syntaxerror_indented_caret_position
    text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 66: ordinal not in range(128)

======================================================================
ERROR: test_syntaxerror_unindented_caret_position (test.test_cmd_line_script.CmdLineTest.test_syntaxerror_unindented_caret_position)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_cmd_line_script.py", line 604, in test_syntaxerror_unindented_caret_position
    text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 66: ordinal not in range(128)

@vstinner
Copy link
Member Author

test_embed failed with:

FAIL: test_init_pybuilddir (test.test_embed.InitConfigTests.test_init_pybuilddir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_embed.py", line 1345, in test_init_pybuilddir
    self.check_all_configs("test_init_compat_config", config,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/test/test_embed.py", line 790, in check_all_configs
    self.check_config(configs, expected_config)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/test/test_embed.py", line 716, in check_config
    self.assertEqual(config, expected)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'_co[351 chars]'], 'xoptions': [], 'warnoptions': [], 'python[1542 chars]': 0} != {'_co[351 chars]'], 'orig_argv': [], 'xoptions': [], 'warnopti[1691 chars]': 0}
  {'_config_init': 1,
   '_init_main': 1,
   '_install_importlib': 1,
   '_isolated_interpreter': 0,
   'argv': [''],
   'base_exec_prefix': '/usr/local',
   'base_executable': '/home/runner/work/cpython/cpython/build/test_python_13115_æ/test_python_worker_966257_æ_tmpdir/tmpa9n7bh3a/_testembed',
   'base_prefix': '/usr/local',
   'buffered_stdio': 1,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'code_debug_ranges': 1,
   'configure_c_stdio': 0,
   'dev_mode': 0,
   'dump_refs': 0,
   'exec_prefix': '/usr/local',
   'executable': '/home/runner/work/cpython/cpython/build/test_python_13115_æ/test_python_worker_966257_æ_tmpdir/tmpa9n7bh3a/_testembed',
   'faulthandler': 0,
   'hash_seed': 0,
   'home': None,
   'import_time': 0,
   'inspect': 0,
   'install_signal_handlers': 1,
   'interactive': 0,
   'isolated': 0,
   'malloc_stats': 0,
   'module_search_paths': ['/usr/local/lib/python312.zip',
                           '/home/runner/work/cpython/cpython/Lib',
                           '/home/runner/work/cpython/cpython/build/lib.linux-x86_64-3.12',
                           '/usr/local/lib/python312.zip',
-                          '/home/runner/work/cpython/cpython/Lib',
+                          '/home/runner/work/cpython/cpython/build/test_python_13115_æ/test_python_worker_966257_æ_tmpdir/tmpa9n7bh3a/Lib',
                           '/home/runner/work/cpython/cpython/build/test_python_13115_æ/test_python_worker_966257_æ_tmpdir/tmpa9n7bh3a/libdir'],
   'module_search_paths_set': 1,
   'optimization_level': 0,
   'orig_argv': [],
   'parse_argv': 0,
   'parser_debug': 0,
   'pathconfig_warnings': 1,
   'platlibdir': 'lib',
   'prefix': '/usr/local',
   'program_name': './_testembed',
   'pycache_prefix': None,
   'pythonpath_env': '/usr/local/lib/python312.zip:/home/runner/work/cpython/cpython/Lib:/home/runner/work/cpython/cpython/build/lib.linux-x86_64-3.12',
   'quiet': 0,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'safe_path': 0,
   'show_ref_count': 0,
   'site_import': 1,
   'skip_source_first_line': 0,
-  'stdlib_dir': '/home/runner/work/cpython/cpython/Lib',
+  'stdlib_dir': '/home/runner/work/cpython/cpython/build/test_python_13115_æ/test_python_worker_966257_æ_tmpdir/tmpa9n7bh3a/Lib',
   'tracemalloc': 0,
   'use_environment': 1,
-  'use_frozen_modules': 1,
?                        ^

+  'use_frozen_modules': True,
?                        ^^^^

   'use_hash_seed': 0,
   'user_site_directory': 1,
   'verbose': 0,
   'warn_default_encoding': 0,
   'warnoptions': [],
   'write_bytecode': 1,
   'xoptions': []}

@vstinner
Copy link
Member Author

test_compileall, test_cmd_line_script and test_urllib failed with UnicodeEncodeError:

I reported issue #93855.

@vstinner
Copy link
Member Author

I wrote PR #93909 which avoids issues #93852 and #93855.

@vstinner vstinner closed this Jun 16, 2022
@vstinner vstinner deleted the regrtest_work_dir branch June 16, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants