Title: [174728] trunk/Tools
Revision
174728
Author
dfar...@apple.com
Date
2014-10-15 10:01:16 -0700 (Wed, 15 Oct 2014)

Log Message

[iOS] LayoutTestRelay: Detect broken pipe when reading simulator app's stdout and stderr.
https://bugs.webkit.org/show_bug.cgi?id=137662

Reviewed by Darin Adler.

The layout test harness can close LayoutTestRelay's subprocess
stdout and stderr in the case of a timeout or if a run is
cancelled and the FIFOs are cleaned up. If LayoutTestRelay
finds that no one is listening to its stdout/stderr (broken
pipe), then just exit(1), there is nothing to report.

* LayoutTestRelay/LayoutTestRelay/LTRelayController.m:
(-[LTRelayController didReceiveStdoutData:]):
Add @try/@catch for NSFileHandleOperationException.
(-[LTRelayController didReceiveStderrData:]):
Add @try/@catch for NSFileHandleOperationException.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (174727 => 174728)


--- trunk/Tools/ChangeLog	2014-10-15 16:53:38 UTC (rev 174727)
+++ trunk/Tools/ChangeLog	2014-10-15 17:01:16 UTC (rev 174728)
@@ -1,3 +1,22 @@
+2014-10-13  David Farler  <dfar...@apple.com>
+
+        [iOS] LayoutTestRelay: Detect broken pipe when reading simulator app's stdout and stderr.
+        https://bugs.webkit.org/show_bug.cgi?id=137662
+
+        Reviewed by Darin Adler.
+
+        The layout test harness can close LayoutTestRelay's subprocess
+        stdout and stderr in the case of a timeout or if a run is
+        cancelled and the FIFOs are cleaned up. If LayoutTestRelay
+        finds that no one is listening to its stdout/stderr (broken
+        pipe), then just exit(1), there is nothing to report.
+
+        * LayoutTestRelay/LayoutTestRelay/LTRelayController.m:
+        (-[LTRelayController didReceiveStdoutData:]):
+        Add @try/@catch for NSFileHandleOperationException.
+        (-[LTRelayController didReceiveStderrData:]):
+        Add @try/@catch for NSFileHandleOperationException.
+
 2014-10-15  Rohit Kumar  <kumar.ro...@samsung.com>
 
         [GTK] Minibrowser : Add keyboard support for zoom in , zoom out and default zoom in GTK Minibrowser

Modified: trunk/Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (174727 => 174728)


--- trunk/Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m	2014-10-15 16:53:38 UTC (rev 174727)
+++ trunk/Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m	2014-10-15 17:01:16 UTC (rev 174728)
@@ -105,12 +105,26 @@
 
 - (void)didReceiveStdoutData:(NSData *)data
 {
-    [[self standardOutput] writeData:data];
+    @try {
+        [[self standardOutput] writeData:data];
+    } @catch (NSException *exception) {
+        // NSFileHandleOperationException
+        // Broken pipe - the test harness stopped listening to us,
+        // probably because we timed out or a run was canceled.
+        exit(EXIT_FAILURE);
+    }
 }
 
 - (void)didReceiveStderrData:(NSData *)data
 {
-    [[self standardError] writeData:data];
+    @try {
+        [[self standardError] writeData:data];
+    } @catch (NSException *exception) {
+        // NSFileHandleOperationException
+        // Broken pipe - the test harness stopped listening to us,
+        // probably because we timed out or a run was canceled.
+        exit(EXIT_FAILURE);
+    }
 }
 
 - (void)didDisconnect
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to