Changeset 261813 in webkit


Ignore:
Timestamp:
May 18, 2020 9:04:24 AM (4 years ago)
Author:
youenn@apple.com
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.

Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261812 r261813  
     12020-05-18  Youenn Fablet  <youenn@apple.com>
     2
     3        webrtc/datachannel/bufferedAmountLowThreshold.html is failing flakily
     4        https://bugs.webkit.org/show_bug.cgi?id=211953
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/datachannel/bufferedAmountLowThreshold-default.html:
     9        Update test to make it more readable and robust, following changes made to webrtc/datachannel/bufferedAmountLowThreshold.html.
     10        * webrtc/datachannel/bufferedAmountLowThreshold.html:
     11        Split the tests in two parts to more easily debug which part (connection setup or sending lots of data) might time out.
     12        Make sure to not send too much data by sending only one burst of data.
     13
    1142020-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold-default.html

    r250836 r261813  
    3131}
    3232
    33 promise_test((test) => {
    34     return new Promise((resolve, reject) => {
     33promise_test(async (test) => {
     34    await new Promise((resolve, reject) => {
    3535        createConnections((localConnection) => {
    3636            localChannel = localConnection.createDataChannel('sendDataChannel');
    37             localChannel.onopen = () => { sendMessages(localChannel); };
    38             localChannel.onbufferedamountlow = () => {
    39                 resolve();
    40             }
    4137            assert_equals(localChannel.bufferedAmountLowThreshold, 0, "default bufferedAmountLowThreshold value");
     38            localChannel.onopen = resolve;
    4239        }, (remoteConnection) => {
     40            remoteConnection.ondatachannel = (event) => {
     41                event.channel.onmessage = () => { };
     42            };
    4343        });
    44         setTimeout(() => reject('timed out'), 5000);
    45     }).then (() => {
    46         closeDataChannels();
     44        setTimeout(() => reject('timed out 1'), 5000);
    4745    });
     46
     47    const promise = new Promise((resolve, reject) => {
     48        localChannel.onbufferedamountlow = resolve;
     49        setTimeout(() => reject('timed out 2'), 5000);
     50    });
     51
     52    sendMessages(localChannel);
     53    await promise;
     54    closeDataChannels();
    4855}, "Default buffer threshold");
    4956
  • trunk/LayoutTests/webrtc/datachannel/bufferedAmountLowThreshold.html

    r250836 r261813  
    2222
    2323var longString = "abcdefgh";
    24 for (var cptr = 0; cptr < 10; ++cptr)
     24for (var cptr = 0; cptr < 14; ++cptr)
    2525    longString += longString;
    2626
    27 function sendContinuouslyMessages(channel)
     27function sendLongMessages(channel)
    2828{
    29     try {
    30         while (channel.bufferedAmount < 200000)
    31             channel.send(longString);
    32 
    33        setTimeout(() => sendContinuouslyMessages(channel), 0);
    34     } catch(e) {
    35     }
     29    channel.send(longString);
     30    channel.send(longString);
     31    channel.send(longString);
     32    channel.send(longString);
     33    channel.send(longString);
     34    channel.send(longString);
     35    channel.send(longString);
     36    channel.send(longString);
    3637}
    3738
    38 promise_test((test) => {
    39     return new Promise((resolve, reject) => {
     39promise_test(async (test) => {
     40    await new Promise((resolve, reject) => {
    4041        createConnections((localConnection) => {
    4142            localChannel = localConnection.createDataChannel('sendDataChannel');
    42             localChannel.onopen = () => {
    43                 sendContinuouslyMessages(localChannel);
    44                 localChannel.onbufferedamountlow = () => {
    45                     resolve();
    46                 }
     43            localChannel.onopen = resolve;
     44            localChannel.bufferedAmountLowThreshold = 100000;
     45        }, (remoteConnection) => {
     46            remoteConnection.ondatachannel = (event) => {
     47                event.channel.onmessage = () => { };
    4748            };
    48             localChannel.bufferedAmountLowThreshold = 200000;
    49         }, (remoteConnection) => {
    5049        });
    51         setTimeout(() => reject('timed out'), 5000);
    52     }).then (() => {
    53         closeDataChannels();
     50        setTimeout(() => reject('timed out 1'), 5000);
    5451    });
     52
     53    const promise = new Promise((resolve, reject) => {
     54        localChannel.onbufferedamountlow = resolve;
     55        setTimeout(() => reject('timed out 2'), 5000);
     56    });
     57    sendLongMessages(localChannel);
     58    await promise;
     59    closeDataChannels();
    5560}, "Large buffer threshold reached");
    5661    </script>
Note: See TracChangeset for help on using the changeset viewer.