Bug 1001787 - Set the endDate on historic experiments early enough. r=bsmedberg, a=sylvestre
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Tue, 29 Apr 2014 13:03:03 +0200
changeset 199058 4faee7717da9cf1a5ccee0554fac35b770f8e176
parent 199057 79f00862656e30cce5e101bb17cb99341969b823
child 199059 2056d140b1bf78273f042444158e2113e5624bb7
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, sylvestre
bugs1001787
milestone31.0a2
Bug 1001787 - Set the endDate on historic experiments early enough. r=bsmedberg, a=sylvestre We expect all historic experiments to have a valid endDate. Setting an experiment to disabled and then calling into reconcileAddonState can trigger calls into Experiments.getExperiments() via the AddonManager, so we need to set the endDate before that.
browser/experiments/Experiments.jsm
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -1695,24 +1695,23 @@ Experiments.ExperimentEntry.prototype = 
    */
   stop: Task.async(function* (terminationKind, terminationReason) {
     this._log.trace("stop() - id=" + this.id + ", terminationKind=" + terminationKind);
     if (!this._enabled) {
       throw new Error("Must not call stop() on an inactive experiment.");
     }
 
     this._enabled = false;
+    let now = this._policy.now();
+    this._lastChangedDate = now;
+    this._endDate = now;
 
     let changes = yield this.reconcileAddonState();
     this._logTermination(terminationKind, terminationReason);
 
-    let now = this._policy.now();
-    this._lastChangedDate = now;
-    this._endDate = now;
-
     if (terminationKind == TELEMETRY_LOG.TERMINATION.ADDON_UNINSTALLED) {
       changes |= this.ADDON_CHANGE_UNINSTALL;
     }
 
     return changes;
   }),
 
   /**