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 524522 4d440c866f4440ff1456835a6836383120d9ed45
parent 524521 5ec94981916f0660a2cd2348ef41a10ffc4fca93
child 524523 18452fcf3bb3a3987eaa4dab2c3da49762305691
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [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));
 }