Skip to content

Commit

Permalink
Fix race condition in the auth db creation
Browse files Browse the repository at this point in the history
This test deletes a database and then tries to go and write to it
without ensuring that it exists. This is just a race with the auth cache
code trying to recreate its own database. This addition just makes sure
it exists by trying to create it and ignoring any 412 errors if the auth
cache won the race.
  • Loading branch information
davisp authored and benoitc committed May 5, 2012
1 parent d58718c commit 39e6b62
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/couch_httpd/share/www/script/test/reader_acl.js
Expand Up @@ -18,6 +18,13 @@ couchTests.reader_acl = function(debug) {
function testFun() {
try {
usersDb.deleteDb();
try {
usersDb.createDb();
} catch(e) {
if(usersDb.last_req.status != 412) {
throw e;
}
}
secretDb.deleteDb();
secretDb.createDb();

Expand Down

0 comments on commit 39e6b62

Please sign in to comment.