<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>226777</bug_id>
          
          <creation_ts>2021-06-08 13:16:10 -0700</creation_ts>
          <short_desc>Windows Python 2.7 fails to start run-webkit-tests due to &quot;ImportError: No module named run-webkit-tests&quot;</short_desc>
          <delta_ts>2022-05-08 22:18:30 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jbedard</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1767874</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-06-08 13:16:10 -0700</bug_when>
    <thetext>Windows Python 2.7 fails to start run-webkit-tests due to &quot;ImportError: No module named run-webkit-tests&quot;

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

(...)
Starting 16 workers ...Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Python27\lib\multiprocessing\forking.py&quot;, line 380, in main
    prepare(preparation_data)
  File &quot;C:\Python27\lib\multiprocessing\forking.py&quot;, 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 &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;C:\Python27\lib\multiprocessing\forking.py&quot;, line 380, in main
    prepare(preparation_data)
  File &quot;C:\Python27\lib\multiprocessing\forking.py&quot;, 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 &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 92, in main
    run_details = run(port, options, args, stderr)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\run_webkit_tests.py&quot;, line 487, in run
    run_details = manager.run(args)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py&quot;, 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 &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py&quot;, 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 &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\manager.py&quot;, line 561, in _run_tests
    return self._runner.run_tests(self._expectations[device_type], new_test_inputs, num_workers, retrying, device_type)
  File &quot;C:\home\webkit\gc\Tools\Scripts\webkitpy\layout_tests\controllers\layout_test_runner.py&quot;, line 172, in run_tests
    ), teardown=teardown_shard,
  File &quot;C:\home\webkit\gc\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\task_pool.py&quot;, line 390, in __enter__
    self.queue.receive()(self)
  File &quot;C:\home\webkit\gc\Tools\Scripts\libraries\webkitcorepy\webkitcorepy\task_pool.py&quot;, line 151, in receive
    return self.incoming.get(timeout=difference)
  File &quot;C:\Python27\lib\multiprocessing\queues.py&quot;, line 132, in get
    raise Empty
Empty


- Python 3 doesn&apos;t have this issue.
- WinCairo tester bots doesn&apos;t report this issue even though they are using Windows Python 2.7.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1767877</commentid>
    <comment_count>1</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-06-08 13:19:22 -0700</bug_when>
    <thetext>Giving --child-processes=1 switch can work around the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1767880</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2021-06-08 13:23:05 -0700</bug_when>
    <thetext>(In reply to Fujii Hironori from comment #1)
&gt; Giving --child-processes=1 switch can work around the problem.

Yes, but that doesn&apos;t really &quot;fix&quot; the problem, the reason that works is because --child-processes=1 doesn&apos;t actually fork.

That being said, if this doesn&apos;t happen on Python 3, perhaps that&apos;s the right solution: just switch to Python 3 (which we are looking at doing this week anyways)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1767886</commentid>
    <comment_count>3</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-06-08 13:34:15 -0700</bug_when>
    <thetext>(In reply to Jonathan Bedard from comment #2)
&gt; That being said, if this doesn&apos;t happen on Python 3, perhaps that&apos;s the
&gt; right solution: just switch to Python 3 (which we are looking at doing this
&gt; week anyways)

I think so, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1769934</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-15 13:17:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/79357902&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867560</commentid>
    <comment_count>5</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2022-05-08 22:18:30 -0700</bug_when>
    <thetext>Python 2.7 is no longer used. Closed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>