From 5b8993e10ba76bfd76cd7b992dfcf33cec4de938 Mon Sep 17 00:00:00 2001 From: benjaminplee Date: Thu, 20 Nov 2014 18:01:51 +0000 Subject: [PATCH] Added basic test for show_dest_status --- test/ibrowse_functional_tests.erl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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) ->