[ 
https://issues.apache.org/jira/browse/COUCHDB-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920145#action_12920145
 ] 

Mathias Leppich commented on COUCHDB-866:
-----------------------------------------

I'm seeing the same error and it appears only when "delayed_commits" is set to 
"false". When set to "true" (current default) the test passes. 

Anyway, the test should be adjusted to wait until the "_design/auth" design 
document has been created in the background instead of failing. right?

> cookie_auth test fail
> ---------------------
>
>                 Key: COUCHDB-866
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-866
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Test Suite
>    Affects Versions: 1.0, 1.0.1
>         Environment: Firefox 3.6.6 without any extensions
> Mac OSX 10.6.4
>            Reporter: christian kirkegaard
>            Priority: Minor
>
> cookie_auth test fail every time with the same error. I have cookies enabled 
> but nothing seems to fix this. Ive even tried different browsers with 
> somewhat same report.
> firefox,
> {"message":"ddoc is 
> null","fileName":"http://127.0.0.1:5984/_utils/script/test/cookie_auth.js","lineNumber":41,"stack":";()@http://127.0.0.1:5984/_utils/script/test/cookie_auth.js:41\u000arun_on_modified_server([object
>  Array],(function () {try {var usersDb = new CouchDB(\"test_suite_users\", 
> {'X-Couch-Full-Commit': \"false\"});usersDb.deleteDb();usersDb.createDb();var 
> ddoc = usersDb.open(\"_design/_auth\");T(ddoc.validate_doc_update);var 
> password = \"3.141592653589\";var jasonUserDoc = 
> CouchDB.prepareUserDoc({name: \"Jason Davies\", roles: [\"dev\"]}, 
> password);T(usersDb.save(jasonUserDoc).ok);var checkDoc = 
> usersDb.open(jasonUserDoc._id);T(checkDoc.name == \"Jason Davies\");var 
> jchrisUserDoc = CouchDB.prepareUserDoc({name: \"[email protected]\"}, 
> \"funnybone\");T(usersDb.save(jchrisUserDoc).ok);var duplicateJchrisDoc = 
> CouchDB.prepareUserDoc({name: \"[email protected]\"}, \"eh, Boo-Boo?\");try 
> {usersDb.save(duplicateJchrisDoc);T(false && \"Can't create duplicate user 
> names. Should have thrown an error.\");} catch (e) {T(e.error == 
> \"conflict\");T(usersDb.last_req.status == 409);}var underscoreUserDoc = 
> CouchDB.prepareUserDoc({name: \"_why\"}, \"copperfield\");try 
> {usersDb.save(underscoreUserDoc);T(false &&  \"Can't create underscore user 
> names. Should have thrown an error.\");} catch (e) {T(e.error == 
> \"forbidden\");T(usersDb.last_req.status == 403);}var badIdDoc = 
> CouchDB.prepareUserDoc({name: \"foo\"}, \"bar\");badIdDoc._id = 
> \"org.apache.couchdb:w00x\";try {usersDb.save(badIdDoc);T(false && \"Can't 
> create malformed docids. Should have thrown an error.\");} catch (e) 
> {T(e.error == \"forbidden\");T(usersDb.last_req.status == 
> 403);}T(CouchDB.login(\"Jason Davies\", 
> password).ok);T(CouchDB.session().userCtx.name == \"Jason 
> Davies\");jasonUserDoc.foo = 
> 2;T(usersDb.save(jasonUserDoc).ok);T(CouchDB.session().userCtx.roles.indexOf(\"_admin\")
>  == -1);try {usersDb.deleteDoc(jchrisUserDoc);T(false && \"Can't delete other 
> users docs. Should have thrown an error.\");} catch (e) {T(e.error == 
> \"forbidden\");T(usersDb.last_req.status == 403);}T(!CouchDB.login(\"Jason 
> Davies\", \"2.71828\").ok);T(!CouchDB.login(\"Robert Allen Zimmerman\", 
> \"d00d\").ok);T(CouchDB.session().userCtx.name != \"Jason Davies\");xhr = 
> CouchDB.request(\"POST\", \"/_session?next=/\", {headers: {'Content-Type': 
> \"application/x-www-form-urlencoded\"}, body: 
> \"name=Jason%20Davies&password=\" + encodeURIComponent(password)});if 
> (xhr.status == 200) {T(/Welcome/.test(xhr.responseText));} else {T(xhr.status 
> == 
> 302);T(xhr.getResponseHeader(\"Location\"));}T(CouchDB.login(\"[email protected]\",
>  \"funnybone\").ok);T(CouchDB.session().userCtx.name == 
> \"[email protected]\");T(CouchDB.session().userCtx.roles.length == 
> 0);jasonUserDoc.foo = 3;try {usersDb.save(jasonUserDoc);T(false && \"Can't 
> update someone else's user doc. Should have thrown an error.\");} catch (e) 
> {T(e.error == \"forbidden\");T(usersDb.last_req.status == 
> 403);}jchrisUserDoc.roles = [\"foo\"];try 
> {usersDb.save(jchrisUserDoc);T(false && \"Can't set roles unless you are 
> admin. Should have thrown an error.\");} catch (e) {T(e.error == 
> \"forbidden\");T(usersDb.last_req.status == 
> 403);}T(CouchDB.logout().ok);T(CouchDB.session().userCtx.roles[0] == 
> \"_admin\");jchrisUserDoc.foo = 
> [\"foo\"];T(usersDb.save(jchrisUserDoc).ok);jchrisUserDoc.roles = 
> [\"_bar\"];try {usersDb.save(jchrisUserDoc);T(false && \"Can't add system 
> roles to user's db. Should have thrown an error.\");} catch (e) {T(e.error == 
> \"forbidden\");T(usersDb.last_req.status == 
> 403);}T(CouchDB.login(\"[email protected]\", 
> \"funnybone\").ok);T(CouchDB.session().userCtx.name == 
> \"[email protected]\");T(CouchDB.session().userCtx.roles.indexOf(\"_admin\") 
> == -1);T(CouchDB.session().userCtx.roles.indexOf(\"foo\") != 
> -1);T(CouchDB.logout().ok);T(CouchDB.session().userCtx.roles[0] == 
> \"_admin\");T(CouchDB.session().userCtx.name == 
> null);run_on_modified_server([{section: \"admins\", key: 
> \"[email protected]\", value: \"funnybone\"}], function () 
> {T(CouchDB.login(\"[email protected]\", 
> \"funnybone\").ok);T(CouchDB.session().userCtx.name == 
> \"[email protected]\");T(CouchDB.session().userCtx.roles.indexOf(\"_admin\") 
> != -1);T(CouchDB.session().userCtx.roles.indexOf(\"foo\") != 
> -1);jchrisUserDoc = usersDb.open(jchrisUserDoc._id);delete 
> jchrisUserDoc.salt;delete 
> jchrisUserDoc.password_sha;T(usersDb.save(jchrisUserDoc).ok);T(CouchDB.logout().ok);T(CouchDB.login(\"[email protected]\",
>  \"funnybone\").ok);var s = CouchDB.session();T(s.userCtx.name == 
> \"[email protected]\");T(s.userCtx.roles.indexOf(\"_admin\") != 
> -1);T(s.info.authenticated == \"cookie\");T(s.info.authentication_db == 
> \"test_suite_users\");T(CouchDB.session().userCtx.roles.indexOf(\"foo\") != 
> -1);});} finally 
> {T(CouchDB.logout().ok);}}))@http://127.0.0.1:5984/_utils/script/couch_test_runner.js?0.11.0:363\u000a(true)@http://127.0.0.1:5984/_utils/script/test/cookie_auth.js:241\u000arun(-8)@http://127.0.0.1:5984/_utils/script/couch_test_runner.js?0.11.0:84\u000a"}
> chrome,
> {"message":"Cannot read property 'validate_doc_update' of 
> null","stack":"TypeError: Cannot read property 'validate_doc_update' of 
> null\n    at eval at patchTest 
> (http://127.0.0.1:5984/_utils/script/couch_test_runner.js?0.11.0:37:5)\n    
> at run_on_modified_server 
> (http://127.0.0.1:5984/_utils/script/couch_test_runner.js?0.11.0:363:5)\n    
> at eval at patchTest 
> (http://127.0.0.1:5984/_utils/script/couch_test_runner.js?0.11.0:37:5)\n    
> at run 
> (http://127.0.0.1:5984/_utils/script/couch_test_runner.js?0.11.0:84:7)","type":"non_object_property_load","arguments":["validate_doc_update",null]}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to