Bug 1534304 - Proper fix for a race condition in an about:debugging test. r=daisuke
authorJason Orendorff <jorendorff@mozilla.com>
Tue, 12 Mar 2019 01:53:37 +0000
changeset 521524 4d440c866f44
parent 521523 5ec94981916f
child 521525 18452fcf3bb3
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1534304
milestone67.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 1534304 - Proper fix for a race condition in an about:debugging test. r=daisuke Differential Revision: https://phabricator.services.mozilla.com/D22996
devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js
@@ -90,20 +90,16 @@ add_task(async function testUsbRuntimeUp
   const runtime2Id = evts.filter(e => e.method === "runtime_added")[0].extras.runtime_id;
   const runtime2Extras = Object.assign({}, RUNTIME_2_EXTRAS, {
     "runtime_id": runtime2Id,
   });
 
   info("Remove runtime 1");
   await removeUsbRuntime(USB_RUNTIME_1, mocks, document);
 
-  // Wait a tick for telementry events to settle. (removeUsbRuntime only waits
-  // for the UI to update.)
-  await undefined;
-
   checkTelemetryEvents([
     { method: "runtime_disconnected", extras: runtime1ConnectedExtras },
     { method: "runtime_removed", extras: runtime1Extras },
   ], sessionId);
 
   info("Remove runtime 2");
   await removeUsbRuntime(USB_RUNTIME_2, mocks, document);
 
@@ -125,10 +121,11 @@ async function addUsbRuntime(runtime, mo
 
   info("Wait for the runtime to appear in the sidebar");
   await waitUntil(() => findSidebarItemByText(runtime.shortName, doc));
 }
 
 async function removeUsbRuntime(runtime, mocks, doc) {
   mocks.removeRuntime(runtime.id);
   mocks.emitUSBUpdate();
-  await waitUntil(() => !findSidebarItemByText(runtime.shortName, doc));
+  await waitUntil(() => !findSidebarItemByText(runtime.name, doc) &&
+                        !findSidebarItemByText(runtime.shortName, doc));
 }