⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283307 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 4:20:49 AM (5 years ago)
Author:
youenn@apple.com
Message:

Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=203256
<rdar://problem/56506063>

Reviewed by Eric Carlson.

Source/WebCore:

Test was flaky for a few reasons:

  • Setting local/remote descriptions may change the ICE transports in use so we need to update the ice connection state when setting local/remote descriptions.
  • We start observing ICE transport backend state asynchronously and we might miss the checking state which can happen very quickly. Synthesize it if needed.
  • We were using the ICE connection state value from the backend as well as computing it from our RTCIceTransport objects. We now fully compute it from RTCIceTransport objects. This ensures we have consistent state between RTCIceTransport and RTCPeerConnection objects with regards to ICE state.

Covered by no longer flaky test.

  • Modules/mediastream/PeerConnectionBackend.cpp:

(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):

  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::computeIceConnectionStateFromIceTransports):

  • Modules/mediastream/RTCPeerConnection.h:
  • Modules/mediastream/libwebrtc/LibWebRTCIceTransportBackend.cpp:

(WebCore::LibWebRTCIceTransportBackendObserver::start):

LayoutTests:

Mark webrtc/connection-state.html as flaky as it is probably too restrictive and should be reworked.

  • platform/mac-wk2/TestExpectations:

Unflake test.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283303 r283307  
     12021-09-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=203256
     5        <rdar://problem/56506063>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * TestExpectations:
     10        Mark webrtc/connection-state.html as flaky as it is probably too restrictive and should be reworked.
     11        * platform/mac-wk2/TestExpectations:
     12        Unflake test.
     13
    1142021-09-29  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/TestExpectations

    r283279 r283307  
    20732073webrtc/h264-baseline.html [ Slow ]
    20742074webrtc/h264-high.html [ Slow ]
     2075
     2076webkit.org/b/207798 webrtc/connection-state.html [ Pass Failure ]
    20752077
    20762078imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html [ Pass Failure Slow ]
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r283268 r283307  
    988988webkit.org/b/199089 [ Debug ] plugins/window-open.html [ Skip ]
    989989
    990 # <rdar://problem/56506063> Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html is a flaky failure (203256)
    991 webkit.org/b/203256 [ Debug ] imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html [ Pass Failure ]
    992 
    993990webkit.org/b/205808 fast/text/international/unicode-bidi-other-neutrals.html [ Pass Failure ]
    994991
     
    10331030
    10341031webkit.org/b/207796 [ Release ] fast/box-shadow/hidpi-box-shadow.html [ Pass ImageOnlyFailure ]
    1035 
    1036 webkit.org/b/207798 webrtc/connection-state.html [ Pass Failure ]
    10371032
    10381033webkit.org/b/207938 http/wpt/crypto/derive-hmac-key-crash.any.html [ Pass Crash ]
  • trunk/Source/WebCore/ChangeLog

    r283306 r283307  
     12021-09-30  Youenn Fablet  <youenn@apple.com>
     2
     3        Layout Test imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=203256
     5        <rdar://problem/56506063>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Test was flaky for a few reasons:
     10        - Setting local/remote descriptions may change the ICE transports in use so we need to update the ice connection state when setting local/remote descriptions.
     11        - We start observing ICE transport backend state asynchronously and we might miss the checking state which can happen very quickly. Synthesize it if needed.
     12        - We were using the ICE connection state value from the backend as well as computing it from our RTCIceTransport objects. We now fully compute it from RTCIceTransport objects.
     13          This ensures we have consistent state between RTCIceTransport and RTCPeerConnection objects with regards to ICE state.
     14
     15        Covered by no longer flaky test.
     16
     17        * Modules/mediastream/PeerConnectionBackend.cpp:
     18        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
     19        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
     20        * Modules/mediastream/RTCPeerConnection.cpp:
     21        (WebCore::RTCPeerConnection::updateIceGatheringState):
     22        (WebCore::RTCPeerConnection::updateIceConnectionState):
     23        (WebCore::RTCPeerConnection::computeIceConnectionStateFromIceTransports):
     24        * Modules/mediastream/RTCPeerConnection.h:
     25        * Modules/mediastream/libwebrtc/LibWebRTCIceTransportBackend.cpp:
     26        (WebCore::LibWebRTCIceTransportBackendObserver::start):
     27
    1282021-09-30  Carlos Garcia Campos  <cgarcia@igalia.com>
    229
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp

    r283028 r283307  
    178178        m_peerConnection.updateTransceiversAfterSuccessfulLocalDescription();
    179179        m_peerConnection.updateSctpBackend(WTFMove(sctpBackend));
    180 
     180        m_peerConnection.processIceTransportChanges();
    181181        callback({ });
    182182    });
     
    236236        m_peerConnection.updateTransceiversAfterSuccessfulRemoteDescription();
    237237        m_peerConnection.updateSctpBackend(WTFMove(sctpBackend));
     238        m_peerConnection.processIceTransportChanges();
    238239        callback({ });
    239240    });
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r282802 r283307  
    671671}
    672672
    673 void RTCPeerConnection::updateIceConnectionState(RTCIceConnectionState newState)
    674 {
    675     ALWAYS_LOG(LOGIDENTIFIER, newState);
    676 
    677     queueTaskKeepingObjectAlive(*this, TaskSource::Networking, [this, newState] {
    678         if (isClosed() || m_iceConnectionState == newState)
     673void RTCPeerConnection::updateIceConnectionState(RTCIceConnectionState)
     674{
     675    queueTaskKeepingObjectAlive(*this, TaskSource::Networking, [this] {
     676        if (isClosed())
     677            return;
     678        auto newState = computeIceConnectionStateFromIceTransports();
     679        if (m_iceConnectionState == newState)
    679680            return;
    680681
     
    792793}
    793794
     795void RTCPeerConnection::processIceTransportChanges()
     796{
     797    auto newIceConnectionState = computeIceConnectionStateFromIceTransports();
     798    bool iceConnectionStateChanged = m_iceConnectionState != newIceConnectionState;
     799    m_iceConnectionState = newIceConnectionState;
     800
     801    if (iceConnectionStateChanged && !isClosed())
     802        dispatchEvent(Event::create(eventNames().iceconnectionstatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No));
     803}
     804
    794805void RTCPeerConnection::updateNegotiationNeededFlag(std::optional<uint32_t> eventId)
    795806{
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h

    r282637 r283307  
    193193
    194194    void processIceTransportStateChange(RTCIceTransport&);
     195    void processIceTransportChanges();
    195196
    196197    RTCSctpTransport* sctp() { return m_sctpTransport.get(); }
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCIceTransportBackend.cpp

    r283186 r283307  
    109109        internal->SignalIceTransportStateChanged.connect(this, &LibWebRTCIceTransportBackendObserver::onIceTransportStateChanged);
    110110        internal->SignalGatheringState.connect(this, &LibWebRTCIceTransportBackendObserver::onGatheringStateChanged);
    111         callOnMainThread([protectedThis = Ref { *this }, transportState = internal->GetIceTransportState(), gatheringState = internal->gathering_state()] {
     111        auto transportState = internal->GetIceTransportState();
     112        // We start observing a bit late and might miss the checking state. Synthesize it as needed.
     113        if (transportState > webrtc::IceTransportState::kChecking && transportState != webrtc::IceTransportState::kClosed) {
     114            callOnMainThread([protectedThis = Ref { *this }] {
     115                if (protectedThis->m_client)
     116                    protectedThis->m_client->onStateChanged(RTCIceTransportState::Checking);
     117            });
     118        }
     119        callOnMainThread([protectedThis = Ref { *this }, transportState, gatheringState = internal->gathering_state()] {
    112120            if (!protectedThis->m_client)
    113121                return;
Note: See TracChangeset for help on using the changeset viewer.