aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test/httpc_SUITE.erl
diff options
context:
space:
mode:
authorErland Schönbeck <[email protected]>2015-03-24 13:52:07 +0100
committerErland Schönbeck <[email protected]>2015-03-24 13:52:07 +0100
commite10385909c687590d6522d007bba9d72f3f5c380 (patch)
tree51227978bac92c6eb5f94c4bc20c2b9b7d1c396e /lib/inets/test/httpc_SUITE.erl
parent487446e76102b27fa8df02a353c7fdeec2d091f1 (diff)
downloadotp-e10385909c687590d6522d007bba9d72f3f5c380.tar.gz
otp-e10385909c687590d6522d007bba9d72f3f5c380.tar.bz2
otp-e10385909c687590d6522d007bba9d72f3f5c380.zip
inets: Add new module inets_time_compat with new time API
The new module is backwards compatible.
Diffstat (limited to 'lib/inets/test/httpc_SUITE.erl')
-rw-r--r--lib/inets/test/httpc_SUITE.erl21
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 2193588031..0dfc65e8f7 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -31,7 +31,6 @@
-include("httpc_internal.hrl").
%% Note: This directive should only be used in test suites.
-compile(export_all).
--compile([{nowarn_deprecated_function,{erlang,now,0}}]).
-define(URL_START, "http://").
-define(TLS_URL_START, "https://").
@@ -1934,14 +1933,8 @@ run_clients(NumClients, ServerPort, SeqNumServer) ->
wait4clients([], _Timeout) ->
ok;
wait4clients(Clients, Timeout) when Timeout > 0 ->
- %% Adapt to OTP 18 erlang time API and be backwards compatible
- Time = try
- erlang:monotonic_time()
- catch
- error:undef ->
- %% Use Erlang system time as monotonic time
- erlang:now()
- end,
+ Time = inets_time_compat:monotonic_time(),
+
receive
{'DOWN', _MRef, process, Pid, normal} ->
{value, {Id, _, _}} = lists:keysearch(Pid, 2, Clients),
@@ -2040,14 +2033,8 @@ parse_connection_type(Request) ->
end.
set_random_seed() ->
- %% Adapt to OTP 18 erlang time API and be backwards compatible
- Unique = try
- erlang:unique_integer()
- catch
- error:undef ->
- {MS, S, US} = erlang:now(),
- (MS*1000000+S)*1000000+US
- end,
+ Unique = inets_time_compat:unique_integer(),
+
A = erlang:phash2([make_ref(), self(), Unique]),
random:seed(A, A, A).