summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-18 11:11:41 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-18 11:11:41 +0000
commit9d2d40f25da4f62f4d68172e2c62b4a6eb01e531 (patch)
tree29cb8bbadccfcd6effe3a581076ad5734e3eaf57 /share
parentcde3f3943f0185a8ec98a1a0e6e716202529f239 (diff)
Merged revision 1036407 from trunk:
Make sure that after compaction of the authentication database the old reference counter is released. Same type of issue as in COUCHDB-926. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1036408 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/auth_cache.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/share/www/script/test/auth_cache.js b/share/www/script/test/auth_cache.js
index 75827dbd..e48f7370 100644
--- a/share/www/script/test/auth_cache.js
+++ b/share/www/script/test/auth_cache.js
@@ -238,6 +238,37 @@ couchTests.auth_cache = function(debug) {
T(misses_after === misses_before);
T(hits_after === (hits_before + 1));
+
+ // login, compact authentication DB, login again and verify that
+ // there was a cache hit
+ hits_before = hits_after;
+ misses_before = misses_after;
+
+ T(CouchDB.login("johndoe", "123456").ok);
+
+ hits_after = hits();
+ misses_after = misses();
+
+ T(misses_after === (misses_before + 1));
+ T(hits_after === hits_before);
+
+ T(CouchDB.logout().ok);
+ T(authDb.compact().ok);
+
+ while (authDb.info().compact_running);
+
+ hits_before = hits_after;
+ misses_before = misses_after;
+
+ T(CouchDB.login("johndoe", "123456").ok);
+
+ hits_after = hits();
+ misses_after = misses();
+
+ T(misses_after === misses_before);
+ T(hits_after === (hits_before + 1));
+
+ T(CouchDB.logout().ok);
}