Title: [241917] trunk/Tools
Revision
241917
Author
[email protected]
Date
2019-02-21 15:53:11 -0800 (Thu, 21 Feb 2019)

Log Message

Flaky API Test: TestWebKitAPI.ProcessSwap.SuspendedPageLimit
https://bugs.webkit.org/show_bug.cgi?id=194481

Reviewed by Alex Christensen.

Give the processes a chance to shutdown and wait until we reached the expected number
of processes.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (241916 => 241917)


--- trunk/Tools/ChangeLog	2019-02-21 23:16:20 UTC (rev 241916)
+++ trunk/Tools/ChangeLog	2019-02-21 23:53:11 UTC (rev 241917)
@@ -1,3 +1,15 @@
+2019-02-21  Chris Dumez  <[email protected]>
+
+        Flaky API Test: TestWebKitAPI.ProcessSwap.SuspendedPageLimit
+        https://bugs.webkit.org/show_bug.cgi?id=194481
+
+        Reviewed by Alex Christensen.
+
+        Give the processes a chance to shutdown and wait until we reached the expected number
+        of processes.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2019-02-21  Tim Horton  <[email protected]>
 
         Fix the macOS build

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (241916 => 241917)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2019-02-21 23:16:20 UTC (rev 241916)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2019-02-21 23:53:11 UTC (rev 241917)
@@ -2946,7 +2946,14 @@
     EXPECT_EQ(5u, seenPIDs.size());
 
     // But not all of those processes should still be alive (1 visible, maximumSuspendedPageCount suspended).
-    EXPECT_EQ([processPool _webProcessCountIgnoringPrewarmedAndCached], (1U + maximumSuspendedPageCount));
+    auto expectedProcessCount = 1 + maximumSuspendedPageCount;
+    int timeout = 20;
+    while ([processPool _webProcessCountIgnoringPrewarmedAndCached] != expectedProcessCount && timeout >= 0) {
+        TestWebKitAPI::Util::sleep(0.1);
+        --timeout;
+    }
+
+    EXPECT_EQ(expectedProcessCount, [processPool _webProcessCountIgnoringPrewarmedAndCached]);
 }
 
 TEST(ProcessSwap, PageCache1)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to