From 0c9e037ce8c1eab9a2c7c1bcbbd4cbe3478dca47 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 1 Jun 2016 14:58:43 +0200 Subject: [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. --- .../test/ct_config_SUITE_data/config/test/config_dynamic_SUITE.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/common_test') 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-> -- cgit v1.2.3