[webkit-reviews] review granted: [Bug 58708] new-run-webkit-tests: read stderr from chromium DRT separately : [Attachment 89880] use non-blocking sockets on unix instead

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 15 17:06:58 PDT 2011


Ojan Vafai <ojan at chromium.org> has granted Dirk Pranke <dpranke at chromium.org>'s
request for review:
Bug 58708: new-run-webkit-tests: read stderr from chromium DRT separately
https://bugs.webkit.org/show_bug.cgi?id=58708

Attachment 89880: use non-blocking sockets on unix instead
https://bugs.webkit.org/attachment.cgi?id=89880&action=review

------- Additional Comments from Ojan Vafai <ojan at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=89880&action=review

Looks fine to me. Can't say I really understand what _read_stderr is doing.
Maybe tony or someone with my python experience can comment. I don't think we
need to block getting this on on that though.

The only issue, I'm pretty sure some tests currently have stderr output in
their expected results, so you'll probably need to rebaseline them with this
patch.

> Tools/Scripts/webkitpy/layout_tests/port/chromium.py:578
> +    def _read_stderr(self):
> +	   if sys.platform in ('win32', 'cygwin'):
> +	       import msvcrt
> +	       import win32pipe
> +
> +	       fd = self._proc.stderr.fileno()
> +	       osf = msvcrt.get_osfhandle(fd)
> +	       _, avail, _ = win32pipe.PeekNamedPipe(osf, 0)
> +	       if avail:
> +		   return self._proc.stderr.read(avail)
> +	       return ''
> +	   else:
> +	       if not self._stderr_is_nonblocking:
> +		   import fcntl
> +		   import os
> +		   fd = self._proc.stderr.fileno()
> +		   fl = fcntl.fcntl(fd, fcntl.F_GETFL)
> +		   fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
> +		   self._stderr_is_nonblocking = True
> +	       return self._proc.stderr.read()

this doesn't seem chromium specific. don't other ports need this code as well?


More information about the webkit-reviews mailing list