- Revision
- 124596
- Author
- [email protected]
- Date
- 2012-08-03 04:51:58 -0700 (Fri, 03 Aug 2012)
Log Message
[WTR] process unresponsiveness is reported to the wrong test
https://bugs.webkit.org/show_bug.cgi?id=88404
Reviewed by Zoltan Herczeg.
Do resetting to consistent state after the finished test,
not before the next. This way we can report unresponsiveness
to the test that triggered it, and we do a restart before the
next test so it will start in a functional state.
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitDriver._check_for_driver_crash):
Print the error line for unresponsive web process, otherwise
it's hard to tell what happened.
* WebKitTestRunner/TestController.cpp:
(WTR):
Decreased the default short timeout so we can detect unresponsiveness
before the timer of the test harness times out. It was unnecessarily
high anyway, we should get answer from the web process in those cases
when the short timeout is used in less than a second.
(WTR::TestController::runTest):
(WTR::TestController::run):
* WebKitTestRunner/TestController.h:
(TestController):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::dump):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
(TestInvocation): Make the dump function static as it doesn't need an object.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (124595 => 124596)
--- trunk/Tools/ChangeLog 2012-08-03 11:23:08 UTC (rev 124595)
+++ trunk/Tools/ChangeLog 2012-08-03 11:51:58 UTC (rev 124596)
@@ -1,3 +1,36 @@
+2012-08-03 Balazs Kelemen <[email protected]>
+
+ [WTR] process unresponsiveness is reported to the wrong test
+ https://bugs.webkit.org/show_bug.cgi?id=88404
+
+ Reviewed by Zoltan Herczeg.
+
+ Do resetting to consistent state after the finished test,
+ not before the next. This way we can report unresponsiveness
+ to the test that triggered it, and we do a restart before the
+ next test so it will start in a functional state.
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ (WebKitDriver._check_for_driver_crash):
+ Print the error line for unresponsive web process, otherwise
+ it's hard to tell what happened.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR):
+ Decreased the default short timeout so we can detect unresponsiveness
+ before the timer of the test harness times out. It was unnecessarily
+ high anyway, we should get answer from the web process in those cases
+ when the short timeout is used in less than a second.
+ (WTR::TestController::runTest):
+ (WTR::TestController::run):
+ * WebKitTestRunner/TestController.h:
+ (TestController):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke):
+ (WTR::TestInvocation::dump):
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/TestInvocation.h:
+ (TestInvocation): Make the dump function static as it doesn't need an object.
+
2012-08-03 Sudarsana Nagineni <[email protected]>
[EFL] (REGRESSION 124581) : EFL 64-bit Debug bot is red and build is exiting early after 20 test crashes
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py (124595 => 124596)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py 2012-08-03 11:23:08 UTC (rev 124595)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py 2012-08-03 11:51:58 UTC (rev 124596)
@@ -319,6 +319,8 @@
_log.debug('WebProcess crash, pid = %s, error_line = %s' % (str(pid), error_line))
if error_line.startswith("#PROCESS UNRESPONSIVE - WebProcess"):
self._subprocess_was_unresponsive = True
+ # We want to show this since it's not a regular crash and probably we don't have a crash log.
+ self.error_from_test += error_line
return True
return self.has_crashed()
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (124595 => 124596)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2012-08-03 11:23:08 UTC (rev 124595)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2012-08-03 11:51:58 UTC (rev 124596)
@@ -52,8 +52,11 @@
namespace WTR {
+// defaultLongTimeout + defaultShortTimeout should be less than 35,
+// the default timeout value of the test harness so we can detect an
+// unresponsive web process.
static const double defaultLongTimeout = 30;
-static const double defaultShortTimeout = 15;
+static const double defaultShortTimeout = 3;
static const double defaultNoTimeout = -1;
static WKURLRef blankURL()
@@ -587,17 +590,6 @@
bool TestController::runTest(const char* inputLine)
{
- if (!resetStateToConsistentValues()) {
-#if PLATFORM(MAC)
- pid_t pid = WKPageGetProcessIdentifier(m_mainWebView->page());
- fprintf(stderr, "#PROCESS UNRESPONSIVE - WebProcess (pid %ld)\n", static_cast<long>(pid));
-#else
- fputs("#PROCESS UNRESPONSIVE - WebProcess\n", stderr);
-#endif
- fflush(stderr);
- return false;
- }
-
TestCommand command = parseInputLine(std::string(inputLine));
m_state = RunningTest;
@@ -630,6 +622,9 @@
void TestController::run()
{
+ bool resetDone = resetStateToConsistentValues();
+ ASSERT_UNUSED(resetDone, resetDone);
+
if (m_usingServerMode)
runTestingServerLoop();
else {
Modified: trunk/Tools/WebKitTestRunner/TestController.h (124595 => 124596)
--- trunk/Tools/WebKitTestRunner/TestController.h 2012-08-03 11:23:08 UTC (rev 124595)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2012-08-03 11:51:58 UTC (rev 124596)
@@ -62,6 +62,8 @@
bool beforeUnloadReturnValue() const { return m_beforeUnloadReturnValue; }
void setBeforeUnloadReturnValue(bool value) { m_beforeUnloadReturnValue = value; }
+ bool resetStateToConsistentValues();
+
private:
void initialize(int argc, const char* argv[]);
void run();
@@ -76,8 +78,6 @@
void initializeInjectedBundlePath();
void initializeTestPluginDirectory();
- bool resetStateToConsistentValues();
-
// WKContextInjectedBundleClient
static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (124595 => 124596)
--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2012-08-03 11:23:08 UTC (rev 124595)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2012-08-03 11:51:58 UTC (rev 124596)
@@ -160,14 +160,15 @@
WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get());
+ const char* errorMessage = 0;
TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout);
if (!m_gotInitialResponse) {
- dump("Timed out waiting for initial response from web process\n");
- return;
+ errorMessage = "Timed out waiting for initial response from web process\n";
+ goto end;
}
if (m_error) {
- dump("FAIL\n");
- return;
+ errorMessage = "FAIL\n";
+ goto end;
}
#if ENABLE(INSPECTOR)
@@ -178,24 +179,53 @@
WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
TestController::shared().runUntil(m_gotFinalMessage, TestController::shared().useWaitToDumpWatchdogTimer() ? TestController::LongTimeout : TestController::NoTimeout);
- if (!m_gotFinalMessage)
- dump("Timed out waiting for final message from web process\n");
- else if (m_error)
- dump("FAIL\n");
+ if (!m_gotFinalMessage) {
+ errorMessage = "Timed out waiting for final message from web process\n";
+ goto end;
+ }
+ if (m_error) {
+ errorMessage = "FAIL\n";
+ goto end;
+ }
+end:
#if ENABLE(INSPECTOR)
- WKInspectorClose(WKPageGetInspector(TestController::shared().mainWebView()->page()));
+ if (m_gotInitialResponse)
+ WKInspectorClose(WKPageGetInspector(TestController::shared().mainWebView()->page()));
#endif // ENABLE(INSPECTOR)
+
+ bool resetDone = TestController::shared().resetStateToConsistentValues();
+ // We expect resetting to not fail if there was no error or timeout.
+ ASSERT(resetDone || errorMessage);
+
+ const char* errorMessageToStderr = 0;
+#if PLATFORM(MAC)
+ char buffer[256];
+ if (!resetDone) {
+ pid_t pid = WKPageGetProcessIdentifier(m_mainWebView->page());
+ sprintf(buffer, "#PROCESS UNRESPONSIVE - WebProcess (pid %ld)\n", static_cast<long>(pid));
+ errorMessageToStderr = buffer;
+ }
+#else
+ if (!resetDone)
+ errorMessageToStderr = "#PROCESS UNRESPONSIVE - WebProcess";
+#endif
+
+ if (errorMessage)
+ dump(errorMessage, errorMessageToStderr, true);
}
-void TestInvocation::dump(const char* stringToDump, bool singleEOF)
+void TestInvocation::dump(const char* textToStdout, const char* textToStderr, bool seenError)
{
printf("Content-Type: text/plain\n");
- printf("%s", stringToDump);
+ printf("%s", textToStdout);
+ if (textToStderr)
+ fputs(textToStderr, stderr);
+
fputs("#EOF\n", stdout);
fputs("#EOF\n", stderr);
- if (!singleEOF)
+ if (seenError)
fputs("#EOF\n", stdout);
fflush(stdout);
fflush(stderr);
@@ -254,7 +284,7 @@
WKArrayRef repaintRects = static_cast<WKArrayRef>(WKDictionaryGetItemForKey(messageBodyDictionary, repaintRectsKey.get()));
// Dump text.
- dump(toWTFString(textOutput).utf8().data(), true);
+ dump(toWTFString(textOutput).utf8().data());
// Dump pixels (if necessary).
if (m_dumpPixels && pixelResult)
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (124595 => 124596)
--- trunk/Tools/WebKitTestRunner/TestInvocation.h 2012-08-03 11:23:08 UTC (rev 124595)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.h 2012-08-03 11:51:58 UTC (rev 124596)
@@ -45,7 +45,7 @@
WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
private:
- void dump(const char*, bool singleEOF = false);
+ static void dump(const char* textToStdout, const char* textToStderr = 0, bool seenError = false);
void dumpPixelsAndCompareWithExpected(WKImageRef, WKArrayRef repaintRects);
bool compareActualHashToExpectedAndDumpResults(const char[33]);