From 8b75234f4acb818b3cf357a6debc78937ebd0983 Mon Sep 17 00:00:00 2001 From: Walt Karas Date: Fri, 10 Sep 2021 09:55:56 -0500 Subject: [PATCH] Stabilize regex_revalidate Au test. (#559) Delay sufficiently between writes of config file so the differences in the write times will be greater than the granualirity of the timestamp used by the plugin. (cherry picked from commit 9031965889ab430bd182dd5485ecda451ecb6a8a) --- .../regex_revalidate/regex_revalidate.test.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py b/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py index cd3b581ba08..73e4b50107b 100644 --- a/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py +++ b/tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py @@ -147,7 +147,7 @@ # minimal configuration ts.Disk.records_config.update({ 'proxy.config.diags.debug.enabled': 1, - 'proxy.config.diags.debug.tags': 'regex_revalidate', + 'proxy.config.diags.debug.tags': 'http|regex_revalidate', # 'proxy.config.diags.debug.enabled': 0, 'proxy.config.http.insert_age_in_response': 0, 'proxy.config.http.response_via_str': 3, @@ -185,6 +185,10 @@ # 4 Stage - Reload new regex_revalidate tr = Test.AddTestRun("Reload config add path1") +# Need a sufficient delay so that the modification time difference of the new config file versus +# the old is greater than the granularity of the time stamp used. (The config file write +# happens after the delay.) +tr.DelayStart = 1 tr.Disk.File(regex_revalidate_conf_path, typename="ats:config").AddLines([ path1_rule ]) @@ -214,6 +218,10 @@ # 7 Stage - Reload new regex_revalidate tr = Test.AddTestRun("Reload config add path2") +# Need a sufficient delay so that the modification time difference of the new config file versus +# the old is greater than the granularity of the time stamp used. (The config file write +# happens after the delay.) +tr.DelayStart = 1 tr.Disk.File(regex_revalidate_conf_path, typename="ats:config").AddLines([ path1_rule, 'path2 {}\n'.format(int(time.time()) + 700) @@ -247,6 +255,10 @@ # 10 Stage - regex_revalidate rewrite rule early expire tr = Test.AddTestRun("Reload config change path2") +# Need a sufficient delay so that the modification time difference of the new config file versus +# the old is greater than the granularity of the time stamp used. (The config file write +# happens after the delay.) +tr.DelayStart = 1 tr.Disk.File(regex_revalidate_conf_path, typename="ats:config").AddLines([ path1_rule, 'path2 {}\n'.format(int(time.time()) - 100),