You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2015/06/02 21:35:34 UTC
[03/50] couch commit: updated refs/heads/2080-port-cors-to-chttpd to
529339b
Enable couchdb_os_proc_pool 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/47ccf6ea
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/47ccf6ea
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/47ccf6ea
Branch: refs/heads/2080-port-cors-to-chttpd
Commit: 47ccf6eac56d0a4b8885bbd7fa9ad5b1e07a9716
Parents: 80f8330
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Feb 4 13:32:54 2015 -0800
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Tue Feb 10 11:06:53 2015 -0800
----------------------------------------------------------------------
test/couchdb_os_proc_pool.erl | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/47ccf6ea/test/couchdb_os_proc_pool.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_os_proc_pool.erl b/test/couchdb_os_proc_pool.erl
index afa400b..a698070 100644
--- a/test/couchdb_os_proc_pool.erl
+++ b/test/couchdb_os_proc_pool.erl
@@ -18,11 +18,10 @@
-define(TIMEOUT, 3000).
--ifdef(run_broken_tests).
-
start() ->
Ctx = test_util:start_couch(),
config:set("query_server_config", "os_process_limit", "3", false),
+ timer:sleep(100), %% we need to wait to let gen_server:cast finish
Ctx.
@@ -65,13 +64,16 @@ should_block_new_proc_on_full_pool() ->
?assertEqual(ok, ping_client(Client4)),
Proc4 = get_client_proc(Client4, "4"),
- ?assertEqual(Proc1, Proc4),
+
+ ?assertEqual(Proc1#proc.pid, Proc4#proc.pid),
+ ?assertNotEqual(Proc1#proc.client, Proc4#proc.client),
lists:map(fun(C) ->
?assertEqual(ok, stop_client(C))
end, [Client2, Client3, Client4])
end).
+
should_free_slot_on_proc_unexpected_exit() ->
?_test(begin
Client1 = spawn_client(),
@@ -86,9 +88,12 @@ should_free_slot_on_proc_unexpected_exit() ->
Proc2 = get_client_proc(Client2, "2"),
Proc3 = get_client_proc(Client3, "3"),
- ?assertNotEqual(Proc1, Proc2),
- ?assertNotEqual(Proc2, Proc3),
- ?assertNotEqual(Proc3, Proc1),
+ ?assertNotEqual(Proc1#proc.pid, Proc2#proc.pid),
+ ?assertNotEqual(Proc1#proc.client, Proc2#proc.client),
+ ?assertNotEqual(Proc2#proc.pid, Proc3#proc.pid),
+ ?assertNotEqual(Proc2#proc.client, Proc3#proc.client),
+ ?assertNotEqual(Proc3#proc.pid, Proc1#proc.pid),
+ ?assertNotEqual(Proc3#proc.client, Proc1#proc.client),
?assertEqual(ok, kill_client(Client1)),
@@ -96,9 +101,13 @@ should_free_slot_on_proc_unexpected_exit() ->
?assertEqual(ok, ping_client(Client4)),
Proc4 = get_client_proc(Client4, "4"),
- ?assertNotEqual(Proc4, Proc1),
- ?assertNotEqual(Proc2, Proc4),
- ?assertNotEqual(Proc3, Proc4),
+
+ ?assertEqual(Proc4#proc.pid, Proc1#proc.pid),
+ ?assertNotEqual(Proc4#proc.client, Proc1#proc.client),
+ ?assertNotEqual(Proc2#proc.pid, Proc4#proc.pid),
+ ?assertNotEqual(Proc2#proc.client, Proc4#proc.client),
+ ?assertNotEqual(Proc3#proc.pid, Proc4#proc.pid),
+ ?assertNotEqual(Proc3#proc.client, Proc4#proc.client),
lists:map(fun(C) ->
?assertEqual(ok, stop_client(C))
@@ -169,5 +178,3 @@ loop(Parent, Ref, Proc) ->
Parent ! {die, Ref},
exit(some_error)
end.
-
--endif.