浏览代码

Added basic test for show_dest_status

pull/123/head
benjaminplee 10 年前
父节点
当前提交
5b8993e10b
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. +16
    -1
      test/ibrowse_functional_tests.erl

+ 16
- 1
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) ->

正在加载...
取消
保存