couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [10/48] couch commit: updated refs/heads/master to 7776921
Date Sat, 04 Apr 2015 23:29:05 GMT
Use test_util:with_process_restart in test suite

COUCHDB-2547


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/93d48aa8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/93d48aa8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/93d48aa8

Branch: refs/heads/master
Commit: 93d48aa8f640252b92c0eef0975893833a734bd0
Parents: a60b88f
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Tue Jan 27 10:33:38 2015 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Feb 10 10:40:35 2015 -0800

----------------------------------------------------------------------
 test/couchdb_http_proxy_tests.erl | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/93d48aa8/test/couchdb_http_proxy_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_http_proxy_tests.erl b/test/couchdb_http_proxy_tests.erl
index 9b640da..f8b3645 100644
--- a/test/couchdb_http_proxy_tests.erl
+++ b/test/couchdb_http_proxy_tests.erl
@@ -35,9 +35,11 @@ start() ->
     % (each httpd_global_handlers changes causes couch_httpd restart)
     Ctx = test_util:start_couch(?CONFIG_CHAIN ++ [?CONFIG_FIXTURE_TEMP], []),
     % 49151 is IANA Reserved, let's assume no one is listening there
-    config:set("httpd_global_handlers", "_error",
-        "{couch_httpd_proxy, handle_proxy_req, <<\"http://127.0.0.1:49151/\">>}"
-    ),
+    test_util:with_process_restart(couch_httpd, fun() ->
+        config:set("httpd_global_handlers", "_error",
+            "{couch_httpd_proxy, handle_proxy_req, <<\"http://127.0.0.1:49151/\">>}"
+        )
+    end),
     Ctx.
 
 setup() ->
@@ -45,9 +47,9 @@ setup() ->
     Value = lists:flatten(io_lib:format(
         "{couch_httpd_proxy, handle_proxy_req, ~p}",
         [list_to_binary(proxy_url())])),
-    config:set("httpd_global_handlers", "_test", Value),
-    % let couch_httpd restart
-    timer:sleep(100),
+    test_util:with_process_restart(couch_httpd, fun() ->
+        config:set("httpd_global_handlers", "_test", Value)
+    end),
     Pid.
 
 teardown(Pid) ->


Mime
View raw message