Added basic test for show_dest_status

Project: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/commit/5b8993e1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/tree/5b8993e1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/diff/5b8993e1

Branch: refs/heads/upstream
Commit: 5b8993e10ba76bfd76cd7b992dfcf33cec4de938
Parents: 4b0fb6b
Author: benjaminplee <[email protected]>
Authored: Thu Nov 20 18:01:51 2014 +0000
Committer: benjaminplee <[email protected]>
Committed: Thu Nov 20 18:01:51 2014 +0000

----------------------------------------------------------------------
 test/ibrowse_functional_tests.erl | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/blob/5b8993e1/test/ibrowse_functional_tests.erl
----------------------------------------------------------------------
diff --git a/test/ibrowse_functional_tests.erl 
b/test/ibrowse_functional_tests.erl
index 0e43f6a..8df662b 100644
--- a/test/ibrowse_functional_tests.erl
+++ b/test/ibrowse_functional_tests.erl
@@ -39,7 +39,8 @@ running_server_fixture_test_() ->
         ?TIMEDTEST("Pipeline depth goes down with responses", pipeline_depth),
         ?TIMEDTEST("Timeout closes pipe", closing_pipes),
         ?TIMEDTEST("Requests are balanced over connections", 
balanced_connections),
-        ?TIMEDTEST("Pipeline too small signals retries", small_pipeline)
+        ?TIMEDTEST("Pipeline too small signals retries", small_pipeline),
+        ?TIMEDTEST("Dest status can be gathered", status)
      ]
     }.
 
@@ -127,6 +128,20 @@ small_pipeline() ->
 
     ?assertEqual({error, retry_later}, Response).
 
+status() ->
+    MaxSessions = 10,
+    MaxPipeline = 10,
+    RequestsSent = 100,
+
+    Fun = fun() -> ibrowse:send_req(?BASE_URL ++ "/never_respond", [], get, 
[], [{max_sessions, MaxSessions}, {max_pipeline_size, MaxPipeline}], 
?SHORT_TIMEOUT_MS) end,
+    times(RequestsSent, fun() -> spawn(Fun) end),
+
+    timer:sleep(?PAUSE_FOR_CONNECTIONS_MS),  %% Wait for everyone to get in 
line
+
+    ibrowse:show_dest_status(),
+    ibrowse:show_dest_status("http://localhost:8181";).
+
+
 times(0, _) ->
     ok;
 times(X, Fun) ->

Reply via email to