Bug 1453975 [wpt PR 10458] - Fix race in track-stats.https.html test., a=testonly
authorHenrik Boström <hbos@chromium.org>
Sun, 22 Apr 2018 14:59:15 +0000
changeset 468868 fd08cd58bd9311d3ed4fb84068064a856003c633
parent 468867 f65230bf509558277ddedffa43e9518dcd48adef
child 468869 bf219acff879bf5b48dd41e9f8620a8da1f250ca
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1453975, 10458, 829401, 1012029, 550580
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1453975 [wpt PR 10458] - Fix race in track-stats.https.html test., a=testonly Automatic update from web-platform-testsFix race in track-stats.https.html test. This resolves the onIceConnectionStateComplete probmise when iceConnectionState reaches either 'connected' or 'completed' and fixes the race if it had already reached these states before the function was called. This fix is speculative. I am no longer able to repro the TIMEOUT locally with or without the fix. Bug: 829401 Change-Id: I1dec90250d640d93498c59a932ab5e84a3b96f15 Reviewed-on: https://chromium-review.googlesource.com/1012029 Reviewed-by: Harald Alvestrand <hta@chromium.org> Commit-Queue: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#550580} -- wpt-commits: a4accccea67a4de543edebaa51aa8c8b898aa323 wpt-pr: 10458
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webrtc/RTCPeerConnection-track-stats.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -608280,17 +608280,17 @@
    "16fe3b155e55d1b66181788c93e570b36e5cc67d",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-setRemoteDescription.html": [
    "2a2e3f9ff0a5912fa260d7124f7f5a9c3862c533",
    "testharness"
   ],
   "webrtc/RTCPeerConnection-track-stats.https.html": [
-   "71d7a85e16504ba67a718c2d50526b7d9f8fd4d0",
+   "c31d22b6d9322d6d9b12414682d04137ad8cfb5d",
    "testharness"
   ],
   "webrtc/RTCPeerConnectionIceEvent-constructor.html": [
    "f273bd7fdfc883a15e8fb16fef5309061254c6cc",
    "testharness"
   ],
   "webrtc/RTCRtpCapabilities-helper.js": [
    "22881ddd3cda1a64ff22474562de1568522e9745",
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-track-stats.https.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-track-stats.https.html
@@ -564,24 +564,30 @@
     let stats = [];
     for (let it = report.values(), n = it.next(); !n.done; n = it.next()) {
       if (n.value.type == type)
         stats.push(n.value);
     }
     return stats;
   }
 
-  // Returns a promise that is resolved when pc.iceConnectionState changes to
-  // 'completed'. This is when transport stats can be expected to have its
-  // selectedCandidatePairId defined.
+  // Returns a promise that is resolved when pc.iceConnectionState reaches the
+  // 'connected' or 'completed' state. This is when transport stats can be
+  // expected to have its selectedCandidatePairId defined.
   async function onIceConnectionStateCompleted(pc) {
+    if (pc.iceConnectionState == 'connected' ||
+        pc.iceConnectionState == 'completed') {
+      return Promise.resolve();
+    }
     let resolver = new Resolver();
     pc.oniceconnectionstatechange = e => {
-      if (pc.iceConnectionState == 'completed')
+      if (pc.iceConnectionState == 'connected' ||
+          pc.iceConnectionState == 'completed') {
         resolver.resolve();
+      }
     };
     return resolver.promise;
   }
 
   // Explores the stats graph starting from |stat|, validating each stat
   // (validateRtcStats) and asserting that all stats of the report were visited.
   function validateStatsGraph(report, stat) {
     let visitedIds = new Set();