aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-06-01 14:58:43 +0200
committerSiri Hansen <[email protected]>2016-06-09 14:54:03 +0200
commit0c9e037ce8c1eab9a2c7c1bcbbd4cbe3478dca47 (patch)
treec595f18115757eba4815051ee52ddfc0cf719855 /lib/common_test
parent68ff9f3e4b5387cf38af7aeb1a8b7abbdaa867d8 (diff)
downloadotp-0c9e037ce8c1eab9a2c7c1bcbbd4cbe3478dca47.tar.gz
otp-0c9e037ce8c1eab9a2c7c1bcbbd4cbe3478dca47.tar.bz2
otp-0c9e037ce8c1eab9a2c7c1bcbbd4cbe3478dca47.zip
[ct test] Do reload_config instead of get_config
The test case config_dynamic_SUITE:test_localtime_update sometimes failed on slow machines, since the initial value of 'localtime' is fetched with ct:get_config instead of ct:reload_config. The value is then from the test run start, not from the time of the ct:get_config call. This is now corrected.
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl b/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl
index 0b3f834732..20fdf1034b 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl
+++ b/lib/common_test/test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl
@@ -73,7 +73,7 @@ test_get_known_variable(_)->
% localtime will be updated in 5 seconds, check that
test_localtime_update(_)->
Seconds = 5,
- LT1 = ct:get_config(localtime),
+ LT1 = ct:reload_config(localtime),
timer:sleep(Seconds*1000), % don't want scaling of this timer
LT2 = ct:reload_config(localtime),
case is_diff_ok(LT1, LT2, Seconds) of
@@ -137,6 +137,11 @@ my_dt_to_datetime([{date, D},{time, T}])->
is_diff_ok(DT1, DT2, Seconds)->
GS1 = calendar:datetime_to_gregorian_seconds(my_dt_to_datetime(DT1)),
GS2 = calendar:datetime_to_gregorian_seconds(my_dt_to_datetime(DT2)),
+ ct:log("Checking diff~n"
+ "DT1: ~p, gregorian seconds: ~p~n"
+ "DT2: ~p, gregorian seconds: ~p~n"
+ "Diff: ~p",
+ [DT1,GS1,DT2,GS2,GS2-GS1]),
if
GS2-GS1 > Seconds+Seconds/2;
GS2-GS1 < Seconds-Seconds/2->