Diff
Modified: trunk/Tools/ChangeLog (283125 => 283126)
--- trunk/Tools/ChangeLog 2021-09-27 17:13:06 UTC (rev 283125)
+++ trunk/Tools/ChangeLog 2021-09-27 17:18:12 UTC (rev 283126)
@@ -1,3 +1,24 @@
+2021-09-27 Jonathan Bedard <jbed...@apple.com>
+
+ Exception in run-webkit-tests: Bad file descriptor (Revert)
+ https://bugs.webkit.org/show_bug.cgi?id=229994
+ <rdar://problem/82826083>
+
+ Unreviewed revert.
+
+ Revert of 241391@main, 241474@main, 241546@main and 241782@main
+
+ * Scripts/webkitpy/common/system/filesystem.py:
+ (FileSystem.rmtree):
+ * Scripts/webkitpy/port/server_process.py:
+ (ServerProcess.write):
+ (ServerProcess._wait_for_data_and_update_buffers_using_select):
+ * Scripts/webkitpy/port/simulator_process.py:
+ (SimulatorProcess):
+ (SimulatorProcess._start):
+ * Scripts/webkitpy/xcode/simulated_device.py:
+ (SimulatedDevice.launch_app):
+
2021-09-27 Youenn Fablet <you...@apple.com>
Make sure to reset presenting application pid in case of mediaserverd crash
Modified: trunk/Tools/Scripts/webkitpy/common/system/filesystem.py (283125 => 283126)
--- trunk/Tools/Scripts/webkitpy/common/system/filesystem.py 2021-09-27 17:13:06 UTC (rev 283125)
+++ trunk/Tools/Scripts/webkitpy/common/system/filesystem.py 2021-09-27 17:18:12 UTC (rev 283126)
@@ -290,10 +290,7 @@
def rmtree(self, path):
"""Delete the directory rooted at path, whether empty or not."""
- try:
- shutil.rmtree(path, ignore_errors=True)
- except OSError:
- pass
+ shutil.rmtree(path, ignore_errors=True)
def copytree(self, source, destination):
shutil.copytree(source, destination)
Modified: trunk/Tools/Scripts/webkitpy/port/server_process.py (283125 => 283126)
--- trunk/Tools/Scripts/webkitpy/port/server_process.py 2021-09-27 17:13:06 UTC (rev 283125)
+++ trunk/Tools/Scripts/webkitpy/port/server_process.py 2021-09-27 17:18:12 UTC (rev 283126)
@@ -184,7 +184,7 @@
try:
self._proc.stdin.write(string_utils.encode(bytes))
self._proc.stdin.flush()
- except (IOError, OSError, ValueError):
+ except (IOError, ValueError):
self.stop(0.0)
# stop() calls _reset(), so we have to set crashed to True after calling stop()
# unless we already know that this is a timeout.
@@ -284,10 +284,6 @@
select_fds = (out_fd, err_fd)
try:
read_fds, _, _ = select.select(select_fds, [], select_fds, max(deadline - time.time(), 0))
- except OSError:
- # FIXME: https://bugs.webkit.org/show_bug.cgi?id=229994
- _log.debug('Caught OSError for {}, continuing'.format(self.pid()))
- return
except select.error as e:
# We can ignore EINVAL since it's likely the process just crashed and we'll
# figure that out the next time through the loop in _read().
@@ -316,10 +312,6 @@
_log.debug('{} because of no data while reading stdout for the server process.'.format(self._crash_message))
self._crashed = True
self._error += data
- except OSError:
- # FIXME: https://bugs.webkit.org/show_bug.cgi?id=229994
- _log.debug('Caught OSError for {}, continuing'.format(self.pid()))
- pass
except IOError:
# We can ignore the IOErrors because we will detect if the subporcess crashed
# the next time through the loop in _read()
Modified: trunk/Tools/Scripts/webkitpy/port/simulator_process.py (283125 => 283126)
--- trunk/Tools/Scripts/webkitpy/port/simulator_process.py 2021-09-27 17:13:06 UTC (rev 283125)
+++ trunk/Tools/Scripts/webkitpy/port/simulator_process.py 2021-09-27 17:18:12 UTC (rev 283126)
@@ -31,7 +31,6 @@
class SimulatorProcess(ServerProcess):
- RETRY = 3
class Popen(object):
@@ -107,36 +106,26 @@
# FIXME <rdar://problem/57032042>: This timeout should be 15 seconds
with Timeout(30, handler=RuntimeError('Timed out waiting for pid {} to connect at port {}'.format(self._pid, self._target_host.listening_port())), patch=False):
- for _ in range(self.RETRY):
- stdin = None
- stdout = None
- stderr = None
- try:
- # This order matches the client side connections in Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp setUpIOSLayoutTestCommunication()
- stdin = SimulatorProcess._accept_connection_create_file(self._target_host.listening_socket, 'wb')
- stdout = SimulatorProcess._accept_connection_create_file(self._target_host.listening_socket, 'rb')
- stderr = SimulatorProcess._accept_connection_create_file(self._target_host.listening_socket, 'rb')
-
- self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
- return
-
- except OSError:
- self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
- self._target_host.executive.kill_process(self._proc.pid)
+ stdin = None
+ stdout = None
+ stderr = None
+ try:
+ # This order matches the client side connections in Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp setUpIOSLayoutTestCommunication()
+ stdin = SimulatorProcess._accept_connection_create_file(self._target_host.listening_socket, 'wb')
+ stdout = SimulatorProcess._accept_connection_create_file(self._target_host.listening_socket, 'rb')
+ stderr = SimulatorProcess._accept_connection_create_file(self._target_host.listening_socket, 'rb')
+ except:
+ # We set self._proc as _reset() and _kill() depend on it.
+ self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
+ if self._proc.poll() is not None:
self._reset()
+ raise Exception('App {} with pid {} crashed before stdin could be attached'.format(os.path.basename(self._cmd[0]), self._pid))
+ self._kill()
+ self._reset()
+ raise
- except:
- # We set self._proc as _reset() and _kill() depend on it.
- self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
- if self._proc.poll() is not None:
- self._reset()
- raise Exception('App {} with pid {} crashed before stdin could be attached'.format(os.path.basename(self._cmd[0]), self._pid))
- self._kill()
- self._reset()
- raise
+ self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._target_host)
- raise Exception('Failed to start app {} after {} retries'.format(self._cmd[0], self.RETRY))
-
def stop(self, timeout_secs=3.0):
# Only bother to check for leaks or stderr if the process is still running.
if self.poll() is None:
Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py (283125 => 283126)
--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py 2021-09-27 17:13:06 UTC (rev 283125)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py 2021-09-27 17:18:12 UTC (rev 283126)
@@ -666,17 +666,12 @@
with Timeout(timeout, handler=RuntimeError(u'Timed out waiting for process to open {} on {}'.format(bundle_id, self.udid)), patch=False):
while True:
- output = ''
- try:
- output = self.executive.run_command(
- ['xcrun', 'simctl', 'launch', self.udid, bundle_id] + args,
- env=environment_to_use,
- error_handler=_log_debug_error,
- return_stderr=False,
- )
- except OSError as e:
- _log.debug("simctl launch raised '{}'".format(e))
- continue
+ output = self.executive.run_command(
+ ['xcrun', 'simctl', 'launch', self.udid, bundle_id] + args,
+ env=environment_to_use,
+ error_handler=_log_debug_error,
+ return_stderr=False,
+ )
match = re.match(r'(?P<bundle>[^:]+): (?P<pid>\d+)\n', output)
# FIXME: We shouldn't need to check the PID <rdar://problem/31154075>.
if match and self.executive.check_running_pid(int(match.group('pid'))):