Backed out changeset 633f31aef218 (bug 1397061) for X clock skew failures on a CLOSED TREE
authorshindli <shindli@mozilla.com>
Wed, 06 Jun 2018 18:33:35 +0300
changeset 475838 e42b6189ab12097554c2b247193797384371e58c
parent 475837 de1544d92b89fdf13f89d28cb9c8b6b4b2bfbd90
child 475839 b94d5b9a491f848992d442207a602a85789a2c51
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1397061
milestone62.0a1
backs out633f31aef2189634eaeccec80ec707e095c744ce
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
Backed out changeset 633f31aef218 (bug 1397061) for X clock skew failures on a CLOSED TREE
services/settings/remote-settings.js
services/settings/test/unit/test_remote_settings_poll.js
--- a/services/settings/remote-settings.js
+++ b/services/settings/remote-settings.js
@@ -159,20 +159,17 @@ async function fetchLatestChanges(url, l
       // expected data (e.g. error response - Bug 1259145)
       throw new Error(`Server error response ${JSON.stringify(payload)}`);
     }
     changes = payload.data;
   }
   // The server should always return ETag. But we've had situations where the CDN
   // was interfering.
   const currentEtag = response.headers.has("ETag") ? response.headers.get("ETag") : undefined;
-  let serverTimeMillis = Date.parse(response.headers.get("Date"));
-  // Since the response is served via a CDN, the Date header value could have been cached.
-  const ageSeconds = response.headers.has("Age") ? parseInt(response.headers.get("Age"), 10) : 0;
-  serverTimeMillis += ageSeconds * 1000;
+  const serverTimeMillis = Date.parse(response.headers.get("Date"));
 
   // Check if the server asked the clients to back off.
   let backoffSeconds;
   if (response.headers.has("Backoff")) {
     const value = parseInt(response.headers.get("Backoff"), 10);
     if (!isNaN(value)) {
       backoffSeconds = value;
     }
--- a/services/settings/test/unit/test_remote_settings_poll.js
+++ b/services/settings/test/unit/test_remote_settings_poll.js
@@ -243,39 +243,16 @@ add_task(async function test_check_clock
 
   clockDifference = Services.prefs.getIntPref(PREF_CLOCK_SKEW_SECONDS);
   // we previously set the serverTime to Date.now() + 10000 ms past epoch
   Assert.ok(clockDifference <= 0 && clockDifference >= -10);
 });
 add_task(clear_state);
 
 
-add_task(async function test_check_clockskew_takes_age_into_account() {
-  const currentTime = Date.now();
-  const skew = 5000;
-  const serverTime = currentTime - skew;
-  const ageCDN = 3600;
-
-  function serverResponse(request, response) {
-    response.setHeader("Content-Type", "application/json; charset=UTF-8");
-    response.setHeader("Date", (new Date(serverTime)).toUTCString());
-    response.setHeader("Age", `${ageCDN}`);
-    response.write(JSON.stringify({data: []}));
-    response.setStatusLine(null, 200, "OK");
-  }
-  server.registerPathHandler(CHANGES_PATH, serverResponse);
-
-  await RemoteSettings.pollChanges();
-
-  const clockSkew = Services.prefs.getIntPref(PREF_CLOCK_SKEW_SECONDS);
-  Assert.equal(clockSkew, skew / 1000 - ageCDN, `clockSkew is ${clockSkew}`);
-});
-add_task(clear_state);
-
-
 add_task(async function test_backoff() {
   const startHistogram = getUptakeTelemetrySnapshot(TELEMETRY_HISTOGRAM_KEY);
 
   function simulateBackoffResponse(request, response) {
     response.setHeader("Content-Type", "application/json; charset=UTF-8");
     response.setHeader("Backoff", "10");
     response.write(JSON.stringify({data: []}));
     response.setStatusLine(null, 200, "OK");