<?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>52872</bug_id>
          
          <creation_ts>2011-01-21 01:03:29 -0800</creation_ts>
          <short_desc>new-run-webkit-tests fails to start HTTP server if there are proxy settings</short_desc>
          <delta_ts>2011-01-24 14:55:42 -0800</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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Xianzhu Wang">phnixwxz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dpranke</cc>
    
    <cc>eric</cc>
    
    <cc>evan</cc>
    
    <cc>levin</cc>
    
    <cc>mihaip</cc>
    
    <cc>ojan</cc>
    
    <cc>tony</cc>
    
    <cc>wangxianzhu</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>337924</commentid>
    <comment_count>0</comment_count>
    <who name="Xianzhu Wang">phnixwxz</who>
    <bug_when>2011-01-21 01:03:29 -0800</bug_when>
    <thetext>new-run-webkit-tests script checks if the testing HTTP server has been properly started by sending testing requests to the server with urllib.urlopen(). However, in an environment with proxy set, urllib.urlopen() can&apos;t recognize the no_proxy settings, and always use proxy even to access http://127.0.0.1:8000/. This causes the checker fails to check the status of HTTP servers and reports &apos;failed to start httpd.&apos;

To resolve this, we can explicitly disable proxies in urllib.urlopen().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337928</commentid>
    <comment_count>1</comment_count>
    <who name="Xianzhu Wang">phnixwxz</who>
    <bug_when>2011-01-21 01:11:02 -0800</bug_when>
    <thetext>Even sometimes urlopen can recognize no_proxy config for non-https requests, the proxy setting sometimes still causes &quot;SSL unknown protocol&quot; error.  Forcing disabling proxy can resolve this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337930</commentid>
    <comment_count>2</comment_count>
      <attachid>79708</attachid>
    <who name="Xianzhu Wang">wangxianzhu</who>
    <bug_when>2011-01-21 01:18:20 -0800</bug_when>
    <thetext>Created attachment 79708
The patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337957</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-01-21 02:22:58 -0800</bug_when>
    <thetext>How does one set a proxy so as to trigger this?

Can we unit test this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337966</commentid>
    <comment_count>4</comment_count>
    <who name="Xianzhu Wang">wangxianzhu</who>
    <bug_when>2011-01-21 02:51:37 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; How does one set a proxy so as to trigger this?

I reproduce the issue on an Ubuntu Lucid with the following proxy settings:
 * Manual proxy configuration
 * Use the same proxy for all protocols
 * HTTP proxy: some valid proxy server
 * Ignored Host list:
      localhost
      127.0.0.1/8
      *.local

$ python (before this, should start a web server serving https on 8443 port) 
&gt;&gt;&gt; import urllib
&gt;&gt;&gt; urllib.urlopen(&apos;https://127.0.0.1:8443/&apos;)
Traceback (most recent call last):
  File &quot;/usr/lib/python2.6/urllib.py&quot;, line 86, in urlopen
    return opener.open(url)
  File &quot;/usr/lib/python2.6/urllib.py&quot;, line 205, in open
    return getattr(self, name)(url)
  File &quot;/usr/lib/python2.6/urllib.py&quot;, line 439, in open_https
    h.endheaders()
  File &quot;/usr/lib/python2.6/httplib.py&quot;, line 904, in endheaders
    self._send_output()
  File &quot;/usr/lib/python2.6/httplib.py&quot;, line 776, in _send_output
    self.send(msg)
  File &quot;/usr/lib/python2.6/httplib.py&quot;, line 735, in send
    self.connect()
  File &quot;/usr/lib/python2.6/httplib.py&quot;, line 1112, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File &quot;/usr/lib/python2.6/ssl.py&quot;, line 350, in wrap_socket
    suppress_ragged_eofs=suppress_ragged_eofs)
  File &quot;/usr/lib/python2.6/ssl.py&quot;, line 118, in __init__
    self.do_handshake()
  File &quot;/usr/lib/python2.6/ssl.py&quot;, line 293, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [Errno 1] _ssl.c:480: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

&gt;&gt;&gt; urllib.urlopen(&apos;https://127.0.0.1:8443/&apos;, proxies={})
&lt;addinfourl at 19614032 whose fp = &lt;socket._fileobject object at 0x129f550&gt;&gt;
&gt;&gt;&gt; 

This seems a bug of python or some underlying library. Unsetting http_proxy, https_proxy, all_proxy environment variables doesn&apos;t help. I searched the error message and knew that many people encountered this and disabling proxy can resolve.

&gt; 
&gt; Can we unit test this?

I&apos;ve no idea. Is it necessary?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337977</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-01-21 03:13:36 -0800</bug_when>
    <thetext>Tests are generally more important than code fixes :)  As they prevent us from making the same bugs twice!  But if it&apos;s not possible to unit test this then we don&apos;t need to.  It may not be realistic to unit test this give that it depends on system settings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>338135</commentid>
    <comment_count>6</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-01-21 10:15:33 -0800</bug_when>
    <thetext>Will DRT pick up system proxy settings?  If so, can having a proxy set cause the http layout tests to fail?

Would it be better to just detect there is a proxy set and provide a good warning message to the user (e.g., what environment variables to set to disable when running the tests)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>338479</commentid>
    <comment_count>7</comment_count>
    <who name="Xianzhu Wang">wangxianzhu</who>
    <bug_when>2011-01-21 19:50:26 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Will DRT pick up system proxy settings?  If so, can having a proxy set cause the http layout tests to fail?
&gt; 

A correct proxy setting should bypass localhost, and webkit can handle this correctly, so layout tests won&apos;t fail. The problem only occurs during python urllib.urlopen().

&gt; Would it be better to just detect there is a proxy set and provide a good warning message to the user (e.g., what environment variables to set to disable when running the tests)?

Environment variables is not the only way to set proxy. Only unsetting environment variables seems not working for me. And I think disabling proxy before testing might be annoying for people who rely on proxies all the time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>339138</commentid>
    <comment_count>8</comment_count>
      <attachid>79708</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-01-24 11:39:20 -0800</bug_when>
    <thetext>Comment on attachment 79708
The patch

I see, given that DRT should be able to handle system proxy settings and this is just a bug with python on Linux, this seems fine to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>339265</commentid>
    <comment_count>9</comment_count>
      <attachid>79708</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-01-24 14:22:50 -0800</bug_when>
    <thetext>Comment on attachment 79708
The patch

Clearing flags on attachment: 79708

Committed r76547: &lt;http://trac.webkit.org/changeset/76547&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>339266</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-01-24 14:22:55 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>339284</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-01-24 14:55:42 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/76547 might have broken Qt Linux Release
The following tests are not passing:
fast/text/international/cjk-segmentation.html</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>79708</attachid>
            <date>2011-01-21 01:18:20 -0800</date>
            <delta_ts>2011-01-24 14:22:49 -0800</delta_ts>
            <desc>The patch</desc>
            <filename>patch52872.txt</filename>
            <type>text/plain</type>
            <size>1997</size>
            <attacher name="Xianzhu Wang">wangxianzhu</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDc2MzM0KQorKysgVG9vbHMvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMg
KzEsMTUgQEAKKzIwMTEtMDEtMjEgIFhpYW56aHUgV2FuZyAgPHdhbmd4aWFuemh1QGdvb2dsZS5j
b20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgbmV3
LXJ1bi13ZWJraXQtdGVzdHMgZmFpbHMgdG8gc3RhcnQgSFRUUCBzZXJ2ZXIgaWYgdGhlcmUgYXJl
IHByb3h5IHNldHRpbmdzCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD01Mjg3MgorCisgICAgICAgIEZvcmNlIGRpc2FibGluZyBwcm94eSB0byByZXNvbHZl
IHRoZSBwcm9ibGVtLgorCisgICAgICAgICogU2NyaXB0cy93ZWJraXRweS9sYXlvdXRfdGVzdHMv
cG9ydC9odHRwX3NlcnZlcl9iYXNlLnB5OgorICAgICAgICAqIFNjcmlwdHMvd2Via2l0cHkvbGF5
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XJsLCBlKSkKSW5kZXg6IFRvb2xzL1NjcmlwdHMv
d2Via2l0cHkvbGF5b3V0X3Rlc3RzL3BvcnQvd2Vic29ja2V0X3NlcnZlci5weQo9PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
Ci0tLSBUb29scy9TY3JpcHRzL3dlYmtpdHB5L2xheW91dF90ZXN0cy9wb3J0L3dlYnNvY2tldF9z
ZXJ2ZXIucHkJKHJldmlzaW9uIDc2MzM0KQorKysgVG9vbHMvU2NyaXB0cy93ZWJraXRweS9sYXlv
dXRfdGVzdHMvcG9ydC93ZWJzb2NrZXRfc2VydmVyLnB5CSh3b3JraW5nIGNvcHkpCkBAIC03Myw3
ICs3Myw3IEBAIGRlZiB1cmxfaXNfYWxpdmUodXJsKToKICAgICB3YWl0X3RpbWUgPSAxMAogICAg
IHdoaWxlIHdhaXRfdGltZSA+IDA6CiAgICAgICAgIHRyeToKLSAgICAgICAgICAgIHJlc3BvbnNl
ID0gdXJsbGliLnVybG9wZW4odXJsKQorICAgICAgICAgICAgcmVzcG9uc2UgPSB1cmxsaWIudXJs
b3Blbih1cmwsIHByb3hpZXM9e30pCiAgICAgICAgICAgICAjIFNlcnZlciBpcyB1cCBhbmQgcmVz
cG9uZGluZy4KICAgICAgICAgICAgIHJldHVybiBUcnVlCiAgICAgICAgIGV4Y2VwdCBJT0Vycm9y
Ogo=
</data>

          </attachment>
      

    </bug>

</bugzilla>