Bug 683396 follow-up: fix test fixtures to avoid test hangs on opt builds. r=me
authorPhilipp von Weitershausen <philipp@weitershausen.de>
Wed, 07 Sep 2011 12:12:46 -0700
changeset 78060 752ab20f2ff82b1066f595a167a81bee94ad7f67
parent 78059 474cf6d733df8b733efe6a4a25f12e544525c5e4
child 78061 cd782e4f3a1bddcacd16113cf4c1336b6f4de382
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs683396
milestone9.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 683396 follow-up: fix test fixtures to avoid test hangs on opt builds. r=me
services/sync/tests/unit/test_errorhandler.js
--- a/services/sync/tests/unit/test_errorhandler.js
+++ b/services/sync/tests/unit/test_errorhandler.js
@@ -807,18 +807,20 @@ add_test(function test_meta_global_login
 });
 
 add_test(function test_crypto_keys_login_server_maintenance_error() {
   // Test crypto/keys server maintenance errors are not reported.
   let server = sync_httpd_setup();
   setUp();
 
   Service.clusterURL = "http://localhost:8080/maintenance/";
+  Service.username = "foo";
+  // Force re-download of keys
+  CollectionKeys.clear();
 
-  Service.username = "foo";
   let backoffInterval;
   Svc.Obs.add("weave:service:backoff:interval", function observe(subject, data) {
     Svc.Obs.remove("weave:service:backoff:interval", observe);
     backoffInterval = subject;
   });
 
   function onUIUpdate() {
     do_throw("Shouldn't get here!");
@@ -936,18 +938,20 @@ add_test(function test_meta_global_login
 });
 
 add_test(function test_crypto_keys_login_prolonged_server_maintenance_error(){
   // Test crypto/keys prolonged server maintenance errors are reported.
   let server = sync_httpd_setup();
   setUp();
 
   Service.clusterURL = "http://localhost:8080/maintenance/";
+  Service.username = "foo";
+  // Force re-download of keys
+  CollectionKeys.clear();
 
-  Service.username = "foo";
   let backoffInterval;
   Svc.Obs.add("weave:service:backoff:interval", function observe(subject, data) {
     Svc.Obs.remove("weave:service:backoff:interval", observe);
     backoffInterval = subject;
   });
 
   Svc.Obs.add("weave:ui:login:error", function onUIUpdate() {
     Svc.Obs.remove("weave:ui:login:error", onUIUpdate);
@@ -1062,18 +1066,20 @@ add_test(function test_meta_global_login
 
 add_test(function test_crypto_keys_login_syncAndReportErrors_server_maintenance_error() {
   // Test crypto/keys server maintenance errors are reported
   // when calling syncAndReportErrors.
   let server = sync_httpd_setup();
   setUp();
 
   Service.clusterURL = "http://localhost:8080/maintenance/";
+  Service.username = "foo";
+  // Force re-download of keys
+  CollectionKeys.clear();
 
-  Service.username = "foo";
   let backoffInterval;
   Svc.Obs.add("weave:service:backoff:interval", function observe(subject, data) {
     Svc.Obs.remove("weave:service:backoff:interval", observe);
     backoffInterval = subject;
   });
 
   Svc.Obs.add("weave:ui:login:error", function onUIUpdate() {
     Svc.Obs.remove("weave:ui:login:error", onUIUpdate);
@@ -1188,18 +1194,20 @@ add_test(function test_meta_global_login
 
 add_test(function test_crypto_keys_login_syncAndReportErrors_prolonged_server_maintenance_error() {
   // Test crypto/keys server maintenance errors are reported
   // when calling syncAndReportErrors.
   let server = sync_httpd_setup();
   setUp();
 
   Service.clusterURL = "http://localhost:8080/maintenance/";
+  Service.username = "foo";
+  // Force re-download of keys
+  CollectionKeys.clear();
 
-  Service.username = "foo";
   let backoffInterval;
   Svc.Obs.add("weave:service:backoff:interval", function observe(subject, data) {
     Svc.Obs.remove("weave:service:backoff:interval", observe);
     backoffInterval = subject;
   });
 
   Svc.Obs.add("weave:ui:login:error", function onUIUpdate() {
     Svc.Obs.remove("weave:ui:login:error", onUIUpdate);