Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Couchdb timeout on one particular Spec test (regardless of os_process_timeout setting) #15

Open
andrewmilkowski opened this Issue · 4 comments

2 participants

@andrewmilkowski

Hi Debasish

First thanks for this wonderful scala project!

I forked your project first and did some preliminary 2.8.0 port (learning great deal in the process:) now seeing you have done (much better!) port , I reverted to your original git master

All specs pass, except one (below) regardless of the couchdb os_process_timeout (20,000 or >)

Thanks for any suggestions you might have on this

best regards!

[error] Test Failed: Create a document with pass thru validation function in design document creation should be successful
dispatch.StatusCode: Exceptional response code: 500
{"error":"timeout","reason":"{gen_server,call,\n [couch_query_servers,\n {get_proc,{doc,<<\"_design/foo_1\">>,\n {1,\n [<<69,247,23,75,111,225,46,138,187,166,54,105,\n 87,76,37,98>>]},\n {[{<<\"language\">>,<<\"scala\">>},\n {<<\"validate_doc_update\">>,\n <<\"(ndoc: dispatch.json.JsValue,\n odoc: dispatch.json.JsValue, req: Any) => {}\">>},\n {<<\"views\">>,{[]}}]},\n [],false,[]},\n {<<\"_design/foo_1\">>,\n <<\"1-45f7174b6fe12e8abba63669574c2562\">>}}]}"}

at dispatch.HttpExecutor$$anonfun$when$1.apply(Http.scala:101)
at dispatch.HttpExecutor$$anonfun$when$1.apply(Http.scala:99)
at dispatch.HttpExecutor$$anonfun$x$1.apply(Http.scala:95)
at dispatch.Http.pack(Http.scala:73)
at dispatch.HttpExecutor$class.x(Http.scala:89)
at dispatch.Http.x(Http.scala:34)
at dispatch.HttpExecutor$class.when(Http.scala:99)
at dispatch.Http.when(Http.scala:34)
at dispatch.HttpExecutor$class.apply(Http.scala:110)
at dispatch.Http.apply(Http.scala:34)
at scouch.db.ScalaValidationSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalaValidationSpec.scala:58)
at scouch.db.ScalaValidationSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(ScalaValidationSpec.scala:45)
at scouch.db.ScalaValidationSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply(ScalaValidationSpec.scala:45)
at org.scalatest.Spec$$anon$2.apply(Spec.scala:1388)
at org.scalatest.Suite$class.withFixture(Suite.scala:1509)
at scouch.db.ScalaValidationSpec.withFixture(ScalaValidationSpec.scala:18)
at org.scalatest.Spec$class.runTest(Spec.scala:1385)
at scouch.db.ScalaValidationSpec.org$scalatest$BeforeAndAfterEach$$super$runTest(ScalaValidationSpec.scala:18)
at org.scalatest.BeforeAndAfterEach$class.runTest(BeforeAndAfterEach.scala:167)
at scouch.db.ScalaValidationSpec.runTest(ScalaValidationSpec.scala:18)
at org.scalatest.Spec$$anonfun$org$scalatest$Spec$$runTestsInBranch$1.apply(Spec.scala:1310)
at org.scalatest.Spec$$anonfun$org$scalatest$Spec$$runTestsInBranch$1.apply(Spec.scala:1299)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at org.scalatest.Spec$class.org$scalatest$Spec$$runTestsInBranch(Spec.scala:1298)
at org.scalatest.Spec$$anonfun$org$scalatest$Spec$$runTestsInBranch$1.apply(Spec.scala:1318)
at org.scalatest.Spec$$anonfun$org$scalatest$Spec$$runTestsInBranch$1.apply(Spec.scala:1299)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at org.scalatest.Spec$class.org$scalatest$Spec$$runTestsInBranch(Spec.scala:1298)
at org.scalatest.Spec$class.runTests(Spec.scala:1520)
at scouch.db.ScalaValidationSpec.runTests(ScalaValidationSpec.scala:18)
at org.scalatest.Suite$class.run(Suite.scala:1804)
at scouch.db.ScalaValidationSpec.org$scalatest$Spec$$super$run(ScalaValidationSpec.scala:18)
at org.scalatest.Spec$class.run(Spec.scala:1597)
at scouch.db.ScalaValidationSpec.run(ScalaValidationSpec.scala:18)
at org.scalatest.tools.ScalaTestFramework$ScalaTestRunner.run(ScalaTestFramework.scala:40)
at sbt.TestRunner.run(TestFramework.scala:52)
at sbt.TestRunner.runTest$1(TestFramework.scala:66)
at sbt.TestRunner.run(TestFramework.scala:75)
at sbt.TestFramework$$anonfun$9$$anonfun$apply$11.runTest$2(TestFramework.scala:192)
at sbt.TestFramework$$anonfun$9$$anonfun$apply$11$$anonfun$apply$12.apply(TestFramework.scala:203)
at sbt.TestFramework$$anonfun$9$$anonfun$apply$11$$anonfun$apply$12.apply(TestFramework.scala:203)
at sbt.NamedTestTask.run(TestFramework.scala:91)
at sbt.ScalaProject$$anonfun$sbt$ScalaProject$$toTask$1.apply(ScalaProject.scala:187)
at sbt.ScalaProject$$anonfun$sbt$ScalaProject$$toTask$1.apply(ScalaProject.scala:187)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.sbt$impl$RunTask$$runIfNotRoot(RunTask.scala:60)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Control$.trapUnit(Control.scala:19)
at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)

INF: [console logger] dispatch: DELETE http://127.0.0.1:5984/test
INF: [console logger] dispatch: GET http://127.0.0.1:5984/test
** destroyed database
[info] == scouch.db.ScalaValidationSpec ==
[info]
[info] == test-finish ==
[error] Failed: : Total 88, Failed 1, Errors 0, Passed 87, Skipped 0
[info] == test-finish ==
[info]
[info] == test-cleanup ==
[info] == test-cleanup ==
[error] Error running scouch.db.ScalaValidationSpec: Test FAILED
[error] Error running test: One or more subtasks failed
[info]
[info] Total time: 74 s, completed Aug 23, 2010 10:35:18 PM
[info]
[info] Total session time: 76 s, completed Aug 23, 2010 10:35:18 PM
[error] Error during build.

@andrewmilkowski

Using couchdb from git ({"couchdb":"Welcome","version":"0.11.0b912a3e00-git"}
with Erlang:

bash-3.2$ erl
Erlang R14A (erts-5.8) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8

thanks!

@debasishg
Owner

Hi Andrew -

Thanks for using scouchdb!

The problem that u have reported exists in the master and I know about it. What has happened is that the wire protocol for validations have changed in couchdb 1.0. I plan to fix it, but need some time to do that. As you must be knowing these protocols are not documented very well anywhere in the couchdb sites - hence I need to hack through the Erlang implementation of the CouchDB view server to find it. I will do it at the eraliest and let u know. Meanwhile please continue using the rest of the stuff, which should work seamlessly with CouchDB 1.0.

Thanks.

@andrewmilkowski

No problem!

I managed to patch one Spec related to couchdb (POST query with content-type: text/plain, where it should be (by new couchdb spec) application/json (error and patch git diff below)

best regards!

Error:

[error] Test Failed: fetch from view least_cost_lunch should fetch 2 rows for view with option and key specification
dispatch.StatusCode: Exceptional response code: 415
{"error":"bad_content_type","reason":"Content-Type must be application/json"}

---------------- CouchDB trace (debug level)

[debug] [<0.782.0>] 'POST' /test/_design/lunch/_view/least_cost_lunch {1,1}
Headers: [{'Connection',"Keep-Alive"},
{'Content-Length',"46"},
{'Content-Type',"text/plain; charset=UTF-8"},
{'Host',"127.0.0.1:5984"}]
[debug] [<0.782.0>] OAuth Params: []
[debug] [<0.782.0>] Minor error in HTTP request: {bad_ctype,
"Content-Type must be application/json"}
[debug] [<0.782.0>] Stacktrace: [{couch_httpd,validate_ctype,2},
{couch_httpd_view,handle_view_req,3},
{couch_httpd_db,do_db_req,2},
{couch_httpd,handle_request_int,5},
{mochiweb_http,headers,5},
{proc_lib,init_p_do_apply,3}]

Patch:
iff --git a/src/main/scala/scouch/db/Database.scala b/src/main/scala/scouch/db/Database.scala
index 7163d78..3bd63b9 100644
--- a/src/main/scala/scouch/db/Database.scala
+++ b/src/main/scala/scouch/db/Database.scala
@@ -191,10 +191,10 @@ case class Db(couch: Couch, name: String) extends Request(couch / name) with J
this / (v.getViewURIFromName + Options.?(o))

     case (None, Some(k)) =>
  • this / (v.getViewURIFromName) << JsValue.toJson(JsValue(Map("keys" -> k)))
  •      this / (v.getViewURIFromName) <:< Map("Content-Type" -> "application/json") << JsValue.to
    
     case (Some(o), Some(k)) =>
    
  • this / (v.getViewURIFromName + Options.?(o)) << JsValue.toJson(JsValue(Map("keys" -> k)))
  • this / (v.getViewURIFromName + Options.?(o)) <:< Map("Content-Type" -> "application/json" } r ># ('rows ! (list ! obj)) }
@debasishg
Owner

Cool .. will look into it over the weekend. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.