Skip to content

Commit 1a353b2

Browse files
author
Walt Karas
authored
Stabilize regex_revalidate Au test. (#559) (#8360)
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 9031965)
1 parent 2a6156f commit 1a353b2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/gold_tests/pluginTest/regex_revalidate/regex_revalidate.test.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
# minimal configuration
148148
ts.Disk.records_config.update({
149149
'proxy.config.diags.debug.enabled': 1,
150-
'proxy.config.diags.debug.tags': 'regex_revalidate',
150+
'proxy.config.diags.debug.tags': 'http|regex_revalidate',
151151
# 'proxy.config.diags.debug.enabled': 0,
152152
'proxy.config.http.insert_age_in_response': 0,
153153
'proxy.config.http.response_via_str': 3,
@@ -185,6 +185,10 @@
185185

186186
# 4 Stage - Reload new regex_revalidate
187187
tr = Test.AddTestRun("Reload config add path1")
188+
# Need a sufficient delay so that the modification time difference of the new config file versus
189+
# the old is greater than the granularity of the time stamp used. (The config file write
190+
# happens after the delay.)
191+
tr.DelayStart = 1
188192
tr.Disk.File(regex_revalidate_conf_path, typename="ats:config").AddLines([
189193
path1_rule
190194
])
@@ -214,6 +218,10 @@
214218

215219
# 7 Stage - Reload new regex_revalidate
216220
tr = Test.AddTestRun("Reload config add path2")
221+
# Need a sufficient delay so that the modification time difference of the new config file versus
222+
# the old is greater than the granularity of the time stamp used. (The config file write
223+
# happens after the delay.)
224+
tr.DelayStart = 1
217225
tr.Disk.File(regex_revalidate_conf_path, typename="ats:config").AddLines([
218226
path1_rule,
219227
'path2 {}\n'.format(int(time.time()) + 700)
@@ -247,6 +255,10 @@
247255

248256
# 10 Stage - regex_revalidate rewrite rule early expire
249257
tr = Test.AddTestRun("Reload config change path2")
258+
# Need a sufficient delay so that the modification time difference of the new config file versus
259+
# the old is greater than the granularity of the time stamp used. (The config file write
260+
# happens after the delay.)
261+
tr.DelayStart = 1
250262
tr.Disk.File(regex_revalidate_conf_path, typename="ats:config").AddLines([
251263
path1_rule,
252264
'path2 {}\n'.format(int(time.time()) - 100),

0 commit comments

Comments
 (0)