Bug 1271000 - Add explanation of potential test failures in TestClientsEngineStage. r=sebastian
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 25 May 2016 11:03:55 -0700
changeset 299173 c80d58a15cff0cecf948168917c45c50dbf473b1
parent 299172 73817edbdfd6f66e75b13eeb9a883994d04f178d
child 299174 5040cc90f9fc18505d3c9822ca33453ee16f610b
push id77464
push userryanvm@gmail.com
push dateThu, 26 May 2016 15:22:37 +0000
treeherdermozilla-inbound@49beae179207 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1271000
milestone49.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 1271000 - Add explanation of potential test failures in TestClientsEngineStage. r=sebastian MozReview-Commit-ID: 98KOJvB3IXC
mobile/android/tests/background/junit4/src/org/mozilla/android/sync/net/test/TestClientsEngineStage.java
--- a/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/net/test/TestClientsEngineStage.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/net/test/TestClientsEngineStage.java
@@ -51,16 +51,25 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+/**
+ * Some tests in this class run client/server multi-threaded code but JUnit assertions triggered
+ * from background threads do not fail the test. If you see unexplained connection-related test failures,
+ * an assertion on the server may have been thrown. Unfortunately, it is non-trivial to get the background
+ * threads to transfer failures back to the test thread so we leave the tests in this state for now.
+ *
+ * One reason the server might throw an assertion is if you have not installed the crypto policies. See
+ * https://wiki.mozilla.org/Mobile/Fennec/Android/Testing#JUnit4_tests for more information.
+ */
 @RunWith(TestRunner.class)
 public class TestClientsEngineStage extends MockSyncClientsEngineStage {
   public final static String LOG_TAG = "TestClientsEngSta";
 
   public TestClientsEngineStage() throws SyncConfigurationException, IllegalArgumentException, NonObjectJSONException, IOException, CryptoException, URISyntaxException {
     super();
     session = initializeSession();
   }
@@ -596,17 +605,17 @@ public class TestClientsEngineStage exte
     // Body and header are the same.
     assertEquals(Utils.decimalSecondsToMilliseconds(uploadBodyTimestamp),
                  session.config.getPersistedServerClientsTimestamp());
     assertEquals(uploadedRecord.lastModified,
                  session.config.getPersistedServerClientRecordTimestamp());
     assertEquals(uploadHeaderTimestamp, session.config.getPersistedServerClientsTimestamp());
   }
 
-  @Test
+  @Test // client/server multi-threaded
   public void testDownloadHasOurRecord() {
     // Make sure no upload occurs after a download so we can
     // test download in isolation.
     stubUpload = true;
 
     // We've uploaded our local record recently.
     long initialTimestamp = setRecentClientRecordTimestamp();