diff options
author | Rickard Green <[email protected]> | 2015-05-08 17:45:01 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-05-08 17:45:01 +0200 |
commit | 207346e0543143bf1aea11a93bcb24de170fc0ac (patch) | |
tree | 6792897b3d88f175605f216edc4780c54fe98edb /erts/emulator/test/process_SUITE.erl | |
parent | fad4130bd8844097b6406ddc587b2185de1937fe (diff) | |
parent | 6b5905e49c74c4034b55824ce4d1a62455f670bc (diff) | |
download | otp-207346e0543143bf1aea11a93bcb24de170fc0ac.tar.gz otp-207346e0543143bf1aea11a93bcb24de170fc0ac.tar.bz2 otp-207346e0543143bf1aea11a93bcb24de170fc0ac.zip |
Merge branch 'rickard/time-improvement/OTP-11997'
* rickard/time-improvement/OTP-11997:
Allow execution of estone suite on pre OTP-18 systems
Add parallel time monotonicity test-case
Replace usage of erlang:now() in line-tracing
Replace erlang:now() usage in emulator suite
Replace erlang:now() usage in system suite
Misc time improvements
Diffstat (limited to 'erts/emulator/test/process_SUITE.erl')
-rw-r--r-- | erts/emulator/test/process_SUITE.erl | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index bf31655066..105d39f126 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -379,16 +379,15 @@ eat_high(Low) -> process_flag(priority, high), receive after 1000 -> ok end, exit(Low, {you, are, dead}), - {_, Sec, _} = now(), - loop(Sec, Sec). + loop(erlang:monotonic_time() + erlang:convert_time_unit(5,seconds,native)). %% Busy loop for 5 seconds. -loop(OrigSec, CurrentSec) when CurrentSec < OrigSec+5 -> - {_, NewSec, _} = now(), - loop(OrigSec, NewSec); -loop(_, _) -> - ok. +loop(StopTime) -> + case StopTime >= erlang:monotonic_time() of + true -> ok; + false -> loop(StopTime) + end. %% Tries to send two different exit messages to a process. @@ -2450,16 +2449,13 @@ start_node(Config) -> start_node(Config, Args) when is_list(Config) -> Pa = filename:dirname(code:which(?MODULE)), - {A, B, C} = now(), Name = list_to_atom(atom_to_list(?MODULE) ++ "-" ++ atom_to_list(?config(testcase, Config)) ++ "-" - ++ integer_to_list(A) - ++ "-" - ++ integer_to_list(B) + ++ integer_to_list(erlang:system_time(seconds)) ++ "-" - ++ integer_to_list(C)), + ++ integer_to_list(erlang:unique_integer([positive]))), ?t:start_node(Name, slave, [{args, "-pa "++Pa++" "++Args}]). stop_node(Node) -> |