Bug 1294643 - Allow for more conditions in robocop testUnifiedTelemetryClientId; r=me
authorGeoff Brown <gbrown@mozilla.com>
Thu, 15 Sep 2016 07:41:00 -0600
changeset 355368 1642b62501997498ecd090d7d813425133ebcb94
parent 355367 75c41ccb4dc62efe38f6bdfc4123aa52afc2eeea
child 355369 7821e3ae6aec332793047ad00adba18918498e99
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1294643
milestone51.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 1294643 - Allow for more conditions in robocop testUnifiedTelemetryClientId; r=me
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
@@ -100,25 +100,27 @@ public class testUnifiedTelemetryClientI
     private void testJavaCreatesClientId() throws Exception {
         Log.d(LOGTAG, "testJavaCreatesClientId: start");
 
         fAssertFalse("Client id file does not exist yet", getClientIdFile().exists());
 
         final String clientIdFromJava = getClientIdFromJava();
         resetJSCache();
         final String clientIdFromJS = getClientIdFromJS();
-        fAssertEquals("Client ID from Java equals ID from JS", clientIdFromJava, clientIdFromJS);
+        // allow for the case where gecko updates the client ID after the first get
+        final String clientIdFromJavaAgain = getClientIdFromJava();
+        fAssertTrue("Client ID from Java equals ID from JS",
+            clientIdFromJava.equals(clientIdFromJS) ||
+            clientIdFromJavaAgain.equals(clientIdFromJS));
 
-        final String clientIdFromJavaAgain = getClientIdFromJava();
         final String clientIdFromJSCache = getClientIdFromJS();
         resetJSCache();
         final String clientIdFromJSFileAgain = getClientIdFromJS();
-        fAssertEquals("Same client ID retrieved from Java", clientIdFromJava, clientIdFromJavaAgain);
-        fAssertEquals("Same client ID retrieved from JS cache", clientIdFromJava, clientIdFromJSCache);
-        fAssertEquals("Same client ID retrieved from JS file", clientIdFromJava, clientIdFromJSFileAgain);
+        fAssertEquals("Same client ID retrieved from JS cache", clientIdFromJavaAgain, clientIdFromJSCache);
+        fAssertEquals("Same client ID retrieved from JS file", clientIdFromJavaAgain, clientIdFromJSFileAgain);
     }
 
     /**
      * Scenario: JS creates client ID
      *   * Fennec starts on a fresh profile
      *   * Js creates the client ID in datareporting/state.json
      *   * Java access the client ID from the same file
      *   * Assert the client IDs are the same