File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
awx/main/tests/live/tests Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1919from awx .main .tests import data
2020
2121from awx .main .models import Project , JobTemplate , Organization , Inventory
22+ from awx .main .tasks .system import clear_setting_cache
2223
2324
2425logger = logging .getLogger (__name__ )
@@ -61,10 +62,15 @@ def live_tmp_folder():
6162 subprocess .run (GIT_COMMANDS , cwd = source_dir , shell = True )
6263 # force invalidation of key before checking it in case it is stale
6364 cache .delete_many (['AWX_ISOLATION_SHOW_PATHS' ])
65+ settings ._awx_conf_memoizedcache .clear ()
6466 if path not in settings .AWX_ISOLATION_SHOW_PATHS :
6567 logger .info (f'Modifying settings.AWX_ISOLATION_SHOW_PATHS for live test: { settings .AWX_ISOLATION_SHOW_PATHS + [path ]} ' )
6668 settings .AWX_ISOLATION_SHOW_PATHS = settings .AWX_ISOLATION_SHOW_PATHS + [path ]
6769 cache .delete_many (['AWX_ISOLATION_SHOW_PATHS' ])
70+ settings ._awx_conf_memoizedcache .clear ()
71+ # cache is cleared in test environment, but need to clear in test environment
72+ clear_setting_cache .delay (['AWX_ISOLATION_SHOW_PATHS' ])
73+ time .sleep (0.2 ) # allow task to finish, we have no real metric to know
6874 else :
6975 logger .info (f'Believed that { path } is already in settings.AWX_ISOLATION_SHOW_PATHS: { settings .AWX_ISOLATION_SHOW_PATHS } ' )
7076 return path
You can’t perform that action at this time.
0 commit comments