From f8c7e2a63e6244a209c9db34b332c276c8bee8de Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 2 Feb 2011 19:11:28 +0000 Subject: Make server listen on an unused port during unit tests This prevents the tests from failing when another instance of CouchDB is already running on the same machine. Also merging in the fixup of the _error resource from r1066590. COUCHDB-1049 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1066591 13f79535-47bb-0310-9956-ffa450edef68 --- test/etap/160-vhosts.t | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test/etap/160-vhosts.t') diff --git a/test/etap/160-vhosts.t b/test/etap/160-vhosts.t index f4bd5e27..c7dc8f99 100755 --- a/test/etap/160-vhosts.t +++ b/test/etap/160-vhosts.t @@ -41,16 +41,14 @@ handler }). -server() -> "http://127.0.0.1:5984/". +server() -> + lists:concat([ + "http://127.0.0.1:", mochiweb_socket_server:get(couch_httpd, port), "/" + ]). + dbname() -> "etap-test-db". admin_user_ctx() -> {user_ctx, #user_ctx{roles=[<<"_admin">>]}}. -config_files() -> - lists:map(fun test_util:build_file/1, [ - "etc/couchdb/default_dev.ini", - "etc/couchdb/local_dev.ini" - ]). - main(_) -> test_util:init_code_path(), @@ -65,7 +63,7 @@ main(_) -> ok. test() -> - couch_server_sup:start_link(config_files()), + couch_server_sup:start_link(test_util:config_files()), ibrowse:start(), crypto:start(), @@ -118,6 +116,9 @@ test() -> ok = couch_config:set("vhosts", "*/test1", "/etap-test-db/_design/doc1/_show/test", false), + % let couch_httpd restart + timer:sleep(100), + test_regular_request(), test_vhost_request(), test_vhost_request_with_qs(), -- cgit v1.2.3