couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1062177 - /couchdb/trunk/share/www/script/test/auth_cache.js
Date Sat, 22 Jan 2011 15:33:29 GMT
Author: fdmanana
Date: Sat Jan 22 15:33:29 2011
New Revision: 1062177

URL: http://svn.apache.org/viewvc?rev=1062177&view=rev
Log:
Make the auth_cache.js test assertions fail less often

Modified:
    couchdb/trunk/share/www/script/test/auth_cache.js

Modified: couchdb/trunk/share/www/script/test/auth_cache.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/auth_cache.js?rev=1062177&r1=1062176&r2=1062177&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/auth_cache.js (original)
+++ couchdb/trunk/share/www/script/test/auth_cache.js Sat Jan 22 15:33:29 2011
@@ -100,6 +100,7 @@ couchTests.auth_cache = function(debug) 
     misses_before = misses();
 
     T(CouchDB.login("fdmanana", "qwerty").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -110,8 +111,8 @@ couchTests.auth_cache = function(debug) 
     hits_before = hits_after;
     misses_before = misses_after;
 
-    T(CouchDB.logout().ok);
     T(CouchDB.login("fdmanana", "qwerty").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -122,8 +123,8 @@ couchTests.auth_cache = function(debug) 
     hits_before = hits_after;
     misses_before = misses_after;
 
-    T(CouchDB.logout().ok);
     T(CouchDB.login("chris", "the_god_father").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -134,8 +135,8 @@ couchTests.auth_cache = function(debug) 
     hits_before = hits_after;
     misses_before = misses_after;
 
-    T(CouchDB.logout().ok);
     T(CouchDB.login("joe", "functional").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -146,8 +147,8 @@ couchTests.auth_cache = function(debug) 
     hits_before = hits_after;
     misses_before = misses_after;
 
-    T(CouchDB.logout().ok);
     T(CouchDB.login("johndoe", "123456").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -158,8 +159,8 @@ couchTests.auth_cache = function(debug) 
     hits_before = hits_after;
     misses_before = misses_after;
 
-    T(CouchDB.logout().ok);
     T(CouchDB.login("joe", "functional").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -171,8 +172,8 @@ couchTests.auth_cache = function(debug) 
     hits_before = hits_after;
     misses_before = misses_after;
 
-    T(CouchDB.logout().ok);
     T(CouchDB.login("fdmanana", "qwerty").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -189,11 +190,11 @@ couchTests.auth_cache = function(debug) 
     fdmanana.password_sha = new_passwd;
 
     T(authDb.save(fdmanana).ok);
-    T(CouchDB.logout().ok);
 
     // cache was refreshed
     T(CouchDB.login("fdmanana", "qwerty").error === "unauthorized");
     T(CouchDB.login("fdmanana", "foobar").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -201,8 +202,6 @@ couchTests.auth_cache = function(debug) 
     T(misses_after === misses_before);
     T(hits_after === (hits_before + 2));
 
-    T(CouchDB.logout().ok);
-
     hits_before = hits_after;
     misses_before = misses_after;
 
@@ -213,11 +212,11 @@ couchTests.auth_cache = function(debug) 
     fdmanana.password_sha = new_passwd;
 
     T(authDb.save(fdmanana).ok);
-    T(CouchDB.logout().ok);
 
     // cache was refreshed
     T(CouchDB.login("fdmanana", "foobar").error === "unauthorized");
     T(CouchDB.login("fdmanana", "javascript").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -226,7 +225,6 @@ couchTests.auth_cache = function(debug) 
     T(hits_after === (hits_before + 2));
 
     T(authDb.deleteDoc(fdmanana).ok);
-    T(CouchDB.logout().ok);
 
     hits_before = hits_after;
     misses_before = misses_after;
@@ -245,6 +243,7 @@ couchTests.auth_cache = function(debug) 
     misses_before = misses_after;
 
     T(CouchDB.login("johndoe", "123456").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
@@ -252,7 +251,6 @@ couchTests.auth_cache = function(debug) 
     T(misses_after === (misses_before + 1));
     T(hits_after === hits_before);
 
-    T(CouchDB.logout().ok);
     T(authDb.compact().ok);
 
     while (authDb.info().compact_running);
@@ -261,14 +259,13 @@ couchTests.auth_cache = function(debug) 
     misses_before = misses_after;
 
     T(CouchDB.login("johndoe", "123456").ok);
+    T(CouchDB.logout().ok);
 
     hits_after = hits();
     misses_after = misses();
 
     T(misses_after === misses_before);
     T(hits_after === (hits_before + 1));
-
-    T(CouchDB.logout().ok);
   }
 
 



Mime
View raw message