diff options
author | Siri Hansen <[email protected]> | 2013-05-17 12:17:50 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-05-17 12:17:50 +0200 |
commit | 5240f22038603f025274173fad71d0d4dd544bef (patch) | |
tree | be0519aed513de4963f6e423c48f6f8657bc9410 /lib/stdlib/test/gen_server_SUITE.erl | |
parent | a70d09b6e611771b467a91c7ebeca1e14390553a (diff) | |
parent | dca1c83d1f496817a709091576d29d2ad1b976d2 (diff) | |
download | otp-5240f22038603f025274173fad71d0d4dd544bef.tar.gz otp-5240f22038603f025274173fad71d0d4dd544bef.tar.bz2 otp-5240f22038603f025274173fad71d0d4dd544bef.zip |
Merge branch 'siri/cuddle-with-tests' into maint
* siri/cuddle-with-tests:
Fix gen_server_SUITE:call_with_huge_message_queue
Fix zip_SUITE:borderline test
Diffstat (limited to 'lib/stdlib/test/gen_server_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/gen_server_SUITE.erl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index 3b6a3f38bc..a360a0809b 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2012. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1082,13 +1082,23 @@ replace_state(Config) when is_list(Config) -> %% Test that the time for a huge message queue is not %% significantly slower than with an empty message queue. call_with_huge_message_queue(Config) when is_list(Config) -> + case test_server:is_native(gen) of + true -> + {skip, + "gen is native - huge message queue optimization " + "is not implemented"}; + false -> + do_call_with_huge_message_queue() + end. + +do_call_with_huge_message_queue() -> ?line Pid = spawn_link(fun echo_loop/0), - ?line {Time,ok} = tc(fun() -> calls(10, Pid) end), + ?line {Time,ok} = tc(fun() -> calls(10000, Pid) end), ?line [self() ! {msg,N} || N <- lists:seq(1, 500000)], erlang:garbage_collect(), - ?line {NewTime,ok} = tc(fun() -> calls(10, Pid) end), + ?line {NewTime,ok} = tc(fun() -> calls(10000, Pid) end), io:format("Time for empty message queue: ~p", [Time]), io:format("Time for huge message queue: ~p", [NewTime]), |