Title: [261813] trunk/LayoutTests
Revision
261813
Author
you...@apple.com
Date
2020-05-18 09:04:24 -0700 (Mon, 18 May 2020)

Log Message

webrtc/datachannel/bufferedAmountLowThreshold.html is failing flakily
https://bugs.webkit.org/show_bug.cgi?id=211953

Reviewed by Eric Carlson.

* webrtc/datachannel/bufferedAmountLowThreshold-default.html:
Update test to make it more readable and robust, following changes made to webrtc/datachannel/bufferedAmountLowThreshold.html.
* webrtc/datachannel/bufferedAmountLowThreshold.html:
Split the tests in two parts to more easily debug which part (connection setup or sending lots of data) might time out.
Make sure to not send too much data by sending only one burst of data.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261812 => 261813)


--- trunk/LayoutTests/ChangeLog	2020-05-18 15:23:09 UTC (rev 261812)
+++ trunk/LayoutTests/ChangeLog	2020-05-18 16:04:24 UTC (rev 261813)
@@ -1,3 +1,16 @@
+2020-05-18  Youenn Fablet  <you...@apple.com>
+
+        webrtc/datachannel/bufferedAmountLowThreshold.html is failing flakily
+        https://bugs.webkit.org/show_bug.cgi?id=211953
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/datachannel/bufferedAmountLowThreshold-default.html:
+        Update test to make it more readable and robust, following changes made to webrtc/datachannel/bufferedAmountLowThreshold.html.
+        * webrtc/datachannel/bufferedAmountLowThreshold.html:
+        Split the tests in two parts to more easily debug which part (connection setup or sending lots of data) might time out.
+        Make sure to not send too much data by sending only one burst of data.
+
 2020-05-18  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Unexpected capitalization of next word after repositioning caret

Modified: trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html (261812 => 261813)


--- trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html	2020-05-18 15:23:09 UTC (rev 261812)
+++ trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html	2020-05-18 16:04:24 UTC (rev 261813)
@@ -30,21 +30,28 @@
         channel.send(longString);
 }
 
-promise_test((test) => {
-    return new Promise((resolve, reject) => {
+promise_test(async (test) => {
+    await new Promise((resolve, reject) => {
         createConnections((localConnection) => {
             localChannel = localConnection.createDataChannel('sendDataChannel');
-            localChannel._onopen_ = () => { sendMessages(localChannel); };
-            localChannel._onbufferedamountlow_ = () => {
-                resolve();
-            }
             assert_equals(localChannel.bufferedAmountLowThreshold, 0, "default bufferedAmountLowThreshold value");
+            localChannel._onopen_ = resolve;
         }, (remoteConnection) => {
+            remoteConnection._ondatachannel_ = (event) => {
+                event.channel._onmessage_ = () => { };
+            };
         });
-        setTimeout(() => reject('timed out'), 5000);
-    }).then (() => {
-        closeDataChannels();
+        setTimeout(() => reject('timed out 1'), 5000);
     });
+
+    const promise = new Promise((resolve, reject) => {
+        localChannel._onbufferedamountlow_ = resolve;
+        setTimeout(() => reject('timed out 2'), 5000);
+    });
+
+    sendMessages(localChannel);
+    await promise;
+    closeDataChannels();
 }, "Default buffer threshold");
 
     </script>

Modified: trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html (261812 => 261813)


--- trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html	2020-05-18 15:23:09 UTC (rev 261812)
+++ trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html	2020-05-18 16:04:24 UTC (rev 261813)
@@ -21,37 +21,42 @@
 }
 
 var longString = "abcdefgh";
-for (var cptr = 0; cptr < 10; ++cptr)
+for (var cptr = 0; cptr < 14; ++cptr)
     longString += longString;
 
-function sendContinuouslyMessages(channel)
+function sendLongMessages(channel)
 {
-    try {
-        while (channel.bufferedAmount < 200000)
-            channel.send(longString);
-
-       setTimeout(() => sendContinuouslyMessages(channel), 0);
-    } catch(e) {
-    }
+    channel.send(longString);
+    channel.send(longString);
+    channel.send(longString);
+    channel.send(longString);
+    channel.send(longString);
+    channel.send(longString);
+    channel.send(longString);
+    channel.send(longString);
 }
 
-promise_test((test) => {
-    return new Promise((resolve, reject) => {
+promise_test(async (test) => {
+    await new Promise((resolve, reject) => {
         createConnections((localConnection) => {
             localChannel = localConnection.createDataChannel('sendDataChannel');
-            localChannel._onopen_ = () => {
-                sendContinuouslyMessages(localChannel);
-                localChannel._onbufferedamountlow_ = () => {
-                    resolve();
-                }
+            localChannel._onopen_ = resolve;
+            localChannel.bufferedAmountLowThreshold = 100000;
+        }, (remoteConnection) => {
+            remoteConnection._ondatachannel_ = (event) => {
+                event.channel._onmessage_ = () => { };
             };
-            localChannel.bufferedAmountLowThreshold = 200000;
-        }, (remoteConnection) => {
         });
-        setTimeout(() => reject('timed out'), 5000);
-    }).then (() => {
-        closeDataChannels();
+        setTimeout(() => reject('timed out 1'), 5000);
     });
+
+    const promise = new Promise((resolve, reject) => {
+        localChannel._onbufferedamountlow_ = resolve;
+        setTimeout(() => reject('timed out 2'), 5000);
+    });
+    sendLongMessages(localChannel);
+    await promise;
+    closeDataChannels();
 }, "Large buffer threshold reached");
     </script>
   </body>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to