Bug 1584961 - Use sinon matcher instead of exact call list in Normandy preference rollout test r=Gijs
authorMichael Cooper <mcooper@mozilla.com>
Thu, 03 Oct 2019 14:40:43 +0000
changeset 496197 97f48d8b40a6f7e24fa045e846d212ae4ae9c9b8
parent 496196 e7ecb2ae2be1545c8ba64273013b595456b91a8b
child 496198 9bb8a933334ca990dfc5d914f9a95454166eb304
push id36646
push usernerli@mozilla.com
push dateThu, 03 Oct 2019 21:48:01 +0000
treeherdermozilla-central@2e1bfb7458de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1584961
milestone71.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 1584961 - Use sinon matcher instead of exact call list in Normandy preference rollout test r=Gijs This avoids an intermittent test failure when other parts of Firefox set experiments active while this test is running Differential Revision: https://phabricator.services.mozilla.com/D47961
toolkit/components/normandy/test/browser/browser_actions_PreferenceRolloutAction.js
--- a/toolkit/components/normandy/test/browser/browser_actions_PreferenceRolloutAction.js
+++ b/toolkit/components/normandy/test/browser/browser_actions_PreferenceRolloutAction.js
@@ -101,28 +101,21 @@ decorate_task(
     sendEventStub.assertEvents([
       [
         "enroll",
         "preference_rollout",
         recipe.arguments.slug,
         { enrollmentId: rollouts[0].enrollmentId },
       ],
     ]);
-    Assert.deepEqual(
-      setExperimentActiveStub.args,
-      [
-        [
-          "test-rollout",
-          "active",
-          {
-            type: "normandy-prefrollout",
-            enrollmentId: rollouts[0].enrollmentId,
-          },
-        ],
-      ],
+    ok(
+      setExperimentActiveStub.calledWithExactly("test-rollout", "active", {
+        type: "normandy-prefrollout",
+        enrollmentId: rollouts[0].enrollmentId,
+      }),
       "a telemetry experiment should be activated"
     );
 
     // Cleanup
     Services.prefs.getDefaultBranch("").deleteBranch("test.pref1");
     Services.prefs.getDefaultBranch("").deleteBranch("test.pref2");
     Services.prefs.getDefaultBranch("").deleteBranch("test.pref3");
   }