aboutsummaryrefslogtreecommitdiffstats
path: root/lib/percept/test/percept_db_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-03-17 14:42:07 +0100
committerBjörn-Egil Dahlberg <[email protected]>2016-03-17 14:42:07 +0100
commit586e8f0cb587355221ed8a24c4e8ca06e8404192 (patch)
tree520db084a6ac125e6b74c1d446f3ea0bd1c10d3f /lib/percept/test/percept_db_SUITE.erl
parent28f3bae60a4edb9432c29469f6a3c031e0859104 (diff)
parent86743354292ef497401303b6e8566b6f3f738b96 (diff)
downloadotp-586e8f0cb587355221ed8a24c4e8ca06e8404192.tar.gz
otp-586e8f0cb587355221ed8a24c4e8ca06e8404192.tar.bz2
otp-586e8f0cb587355221ed8a24c4e8ca06e8404192.zip
Merge branch 'egil/fix-percept-now/OTP-13422'
* egil/fix-percept-now/OTP-13422: Modernize test suites Use monotonic_time/1 instead of now/0
Diffstat (limited to 'lib/percept/test/percept_db_SUITE.erl')
-rw-r--r--lib/percept/test/percept_db_SUITE.erl36
1 files changed, 7 insertions, 29 deletions
diff --git a/lib/percept/test/percept_db_SUITE.erl b/lib/percept/test/percept_db_SUITE.erl
index 5b878e8462..c1d711060c 100644
--- a/lib/percept/test/percept_db_SUITE.erl
+++ b/lib/percept/test/percept_db_SUITE.erl
@@ -22,54 +22,32 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/1]).
--export([init_per_suite/1, end_per_suite/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
%% Test cases
--export([
- start/1
- ]).
+-export([start/1]).
%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(2)).
-define(restarts, 10).
-define(alive_timeout, 500).
-init_per_suite(Config) when is_list(Config) ->
- Config.
+suite() ->
+ [{timetrap, {minutes, 2}}].
-end_per_suite(Config) when is_list(Config) ->
- Config.
-
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{max_size, 300}, {watchdog,Dog} | Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-all(suite) ->
- % Test cases
+all() ->
[start].
%%----------------------------------------------------------------------
%% Tests
%%----------------------------------------------------------------------
-start(suite) ->
- [];
-start(doc) ->
- ["Percept_db start and restart test."];
+%% Percept_db start and restart test.
start(Config) when is_list(Config) ->
ok = restart(?restarts),
{stopped, _DB} = percept_db:stop(),
ok.
-restart(0)->
- ok;
+restart(0)-> ok;
restart(N)->
{_, DB} = percept_db:start(),
timer:sleep(?alive_timeout),