Bug 226777

Summary: Windows Python 2.7 fails to start run-webkit-tests due to "ImportError: No module named run-webkit-tests"
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Fujii Hironori 2021-06-08 13:16:10 PDT
Windows Python 2.7 fails to start run-webkit-tests due to "ImportError: No module named run-webkit-tests"

On multi-core PC, invoke
  python.exe ./Tools/Scripts/run-webkit-tests --wincairo --debug

(...)
Starting 16 workers ...Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 504, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named run-webkit-tests
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 504, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named run-webkit-tests
(...)
Empty raised:
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 172, in run_tests
    ), teardown=teardown_shard,
  File "C:\home\webkit\gc\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\task_pool.py", line 390, in __enter__
    self.queue.receive()(self)
  File "C:\home\webkit\gc\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\task_pool.py", line 151, in receive
    return self.incoming.get(timeout=difference)
  File "C:\Python27\lib\multiprocessing\queues.py", line 132, in get
    raise Empty
Empty


- Python 3 doesn't have this issue.
- WinCairo tester bots doesn't report this issue even though they are using Windows Python 2.7.
Comment 1 Fujii Hironori 2021-06-08 13:19:22 PDT
Giving --child-processes=1 switch can work around the problem.
Comment 2 Jonathan Bedard 2021-06-08 13:23:05 PDT
(In reply to Fujii Hironori from comment #1)
> Giving --child-processes=1 switch can work around the problem.

Yes, but that doesn't really "fix" the problem, the reason that works is because --child-processes=1 doesn't actually fork.

That being said, if this doesn't happen on Python 3, perhaps that's the right solution: just switch to Python 3 (which we are looking at doing this week anyways)
Comment 3 Fujii Hironori 2021-06-08 13:34:15 PDT
(In reply to Jonathan Bedard from comment #2)
> That being said, if this doesn't happen on Python 3, perhaps that's the
> right solution: just switch to Python 3 (which we are looking at doing this
> week anyways)

I think so, too.
Comment 4 Radar WebKit Bug Importer 2021-06-15 13:17:16 PDT
<rdar://problem/79357902>
Comment 5 Fujii Hironori 2022-05-08 22:18:30 PDT
Python 2.7 is no longer used. Closed.