diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2011-02-02 19:11:28 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2011-02-02 19:11:28 +0000 |
commit | f8c7e2a63e6244a209c9db34b332c276c8bee8de (patch) | |
tree | 574025bccb9cf09f16f9caea488e70d9f4f67c5c /test/etap/150-invalid-view-seq.t | |
parent | 8fe7d459e535acdb1f2975532b6f1248f5089596 (diff) |
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
Diffstat (limited to 'test/etap/150-invalid-view-seq.t')
-rwxr-xr-x | test/etap/150-invalid-view-seq.t | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/etap/150-invalid-view-seq.t b/test/etap/150-invalid-view-seq.t index 0664c116..594d3416 100755 --- a/test/etap/150-invalid-view-seq.t +++ b/test/etap/150-invalid-view-seq.t @@ -19,9 +19,6 @@ handler }). -default_config() -> - test_util:build_file("etc/couchdb/default_dev.ini"). - test_db_name() -> <<"couch_test_invalid_view_seq">>. @@ -42,7 +39,7 @@ main(_) -> %% a huge and ugly but harmless stack trace is sent to stderr %% test() -> - couch_server_sup:start_link([default_config()]), + couch_server_sup:start_link(test_util:config_files()), timer:sleep(1000), delete_db(), create_db(), @@ -54,7 +51,7 @@ test() -> backup_db_file(), put(addr, couch_config:get("httpd", "bind_address", "127.0.0.1")), - put(port, couch_config:get("httpd", "port", "5984")), + put(port, integer_to_list(mochiweb_socket_server:get(couch_httpd, port))), application:start(inets), create_new_doc(), @@ -168,8 +165,9 @@ restore_backup_db_file() -> binary_to_list(test_db_name()) ++ ".couch"), ok = file:delete(DbFile), ok = file:rename(DbFile ++ ".backup", DbFile), - couch_server_sup:start_link([default_config()]), + couch_server_sup:start_link(test_util:config_files()), timer:sleep(1000), + put(port, integer_to_list(mochiweb_socket_server:get(couch_httpd, port))), ok. query_view_after_restore_backup() -> |