Bug 226702 - run-webkit-tests reports "OSError: [WinError 6] The handle is invalid" with Windows Python3
Summary: run-webkit-tests reports "OSError: [WinError 6] The handle is invalid" with W...
Status: RESOLVED DUPLICATE of bug 226710
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-06 17:15 PDT by Fujii Hironori
Modified: 2021-06-07 17:53 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-06-06 17:15:52 PDT
run-webkit-tests reports "OSError: [WinError 6] The handle is invalid" with Windows Python3

Since r278454 (Bug 226234)

PS C:\home\webkit\gc> python3.exe ./Tools/Scripts/run-webkit-tests --wincairo --debug
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = "en_US.UTF-8",
        LC_MESSAGES = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Using port 'wincairo-win10-wk2'
Test configuration: <win10, x86_64, debug>
Placing test results in C:\home\webkit\gc\WebKitBuild\Debug\bin64\layout-test-results
Using Debug build
Pixel tests disabled
Regular timeout: 30000, slow test timeout: 150000
Command line: C:\home\webkit\gc\WebKitBuild\Debug\bin64\WebKitTestRunner.exe -

Found 71450 tests; running 17972, skipping 53478.

Verbose baseline search path: platform\wincairo-win10-wk2 -> platform\wincairo-win10 -> platform\wincairo-wk2 -> platform\wincairo -> platform\wk2 -> generic

Baseline search path: platform\wincairo -> platform\wk2 -> generic

Running 17972 tests

The _NT_SYMBOL_PATH environment variable is not set. Using Microsoft Symbol Server.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = "en_US.UTF-8",
        LC_MESSAGES = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Running 16 WebKitTestRunners in parallel.

Starting 16 workers ...
TypeError raised: cannot pickle '_io.BufferedWriter' object
Traceback (most recent call last):
  File "C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py", line 92, in main
    run_details = run(port, options, args, stderr)
  File "C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py", line 487, in run
    run_details = manager.run(args)
  File "C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py", line 408, in run
    temp_initial_results, temp_retry_results, temp_enabled_pixel_tests_in_retry = self._run_test_subset(test_inputs, device_type=device_type)
  File "C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py", line 482, in _run_test_subset
    initial_results = self._run_tests(test_inputs, self._options.repeat_each, self._options.iterations, int(self._options.child_processes), retrying=False, device_type=device_type)
  File "C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py", line 561, in _run_tests
    return self._runner.run_tests(self._expectations[device_type], new_test_inputs, num_workers, retrying, device_type)
  File "C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\layout_test_runner.py", line 165, in run_tests
    with TaskPool(
  File "C:\home\webkit\gc\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\task_pool.py", line 388, in __enter__
    worker.start()
  File "C:\Python39\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Python39\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Python39\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Python39\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Python39\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_io.BufferedWriter' object
Stopping Web Platform Test server ...Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python39\lib\multiprocessing\spawn.py", line 107, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
  File "C:\Python39\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid
PS C:\home\webkit\gc>
Comment 1 Jonathan Bedard 2021-06-07 08:44:03 PDT
We just need to figure out what object (most likely belonging to the port) is not pickleable, I posted a small function in https://bugs.webkit.org/show_bug.cgi?id=226710 that should be applicable here.
Comment 2 Fujii Hironori 2021-06-07 17:53:57 PDT
Bug 226710's WIP patch (attachment#430795 [details]) solves this issue.

*** This bug has been marked as a duplicate of bug 226710 ***