RESOLVED FIXED Bug 58708
new-run-webkit-tests: read stderr from chromium DRT separately
https://bugs.webkit.org/show_bug.cgi?id=58708
Summary new-run-webkit-tests: read stderr from chromium DRT separately
Dirk Pranke
Reported 2011-04-15 16:26:27 PDT
new-run-webkit-tests: read stderr from chromium DRT separately
Attachments
Patch (6.17 KB, patch)
2011-04-15 16:32 PDT, Dirk Pranke
no flags
use non-blocking sockets on unix instead (6.13 KB, patch)
2011-04-15 16:59 PDT, Dirk Pranke
no flags
Dirk Pranke
Comment 1 2011-04-15 16:32:11 PDT
Dirk Pranke
Comment 2 2011-04-15 16:33:36 PDT
easily the least portable python I've ever written, but it seems to work ...
Dirk Pranke
Comment 3 2011-04-15 16:34:33 PDT
on unix, it might be better to just mark the socket as non-blocking and do a select(), but the patch is posted for the record :).
Dirk Pranke
Comment 4 2011-04-15 16:59:06 PDT
Created attachment 89880 [details] use non-blocking sockets on unix instead
Ojan Vafai
Comment 5 2011-04-15 17:06:58 PDT
Comment on attachment 89880 [details] use non-blocking sockets on unix instead 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?
Dirk Pranke
Comment 6 2011-04-15 17:10:33 PDT
(In reply to comment #5) > (From update of attachment 89880 [details]) > 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. > Yeah, that wouldn't surprise me. > > 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? All of the other ports use the server_process.py code (via port/webkit.py) which uses select and non-blocking reads. As a result we don't have any other ports that will actually work correctly on windows (see bug 38756). As a part of that, we'll likely need to re-use this code there as well in some form.
Dirk Pranke
Comment 7 2011-04-15 17:11:24 PDT
This will probably allow us to figure out whether or not to fix bug 37426, as well.
Dirk Pranke
Comment 8 2011-04-17 14:48:12 PDT
Tony Chang
Comment 9 2011-04-17 15:42:55 PDT
Comment on attachment 89880 [details] use non-blocking sockets on unix instead View in context: https://bugs.webkit.org/attachment.cgi?id=89880&action=review > Tools/Scripts/webkitpy/layout_tests/port/chromium.py:562 > + import msvcrt > + import win32pipe Do both of these exist in cygwin python? I thought cygwin python could import fcntl so maybe it can go through the other code path?
James Robinson
Comment 10 2011-08-23 15:05:20 PDT
This got reverted in http://trac.webkit.org/changeset/84128 but the bug wasn't reopened. I think this is (at least part of) the problem with https://bugs.webkit.org/show_bug.cgi?id=66806
James Robinson
Comment 11 2011-08-23 15:05:47 PDT
Reopening, patch was reverted
Dirk Pranke
Comment 12 2012-05-08 14:41:08 PDT
closing, this is fixed w/ r115490 and r115903.
Note You need to log in before you can comment on or make changes to this bug.