Merge pull request #7 from dwoz/win_pkg_flaky

Fix win_pkg test
This commit is contained in:
Megan Wilhite 2018-10-12 09:03:30 -04:00 committed by GitHub
commit f795b60537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View file

@ -131,7 +131,10 @@ def check_file_list_cache(opts, form, list_cache, w_lock):
if os.path.exists(list_cache):
# calculate filelist age is possible
cache_stat = os.stat(list_cache)
age = time.time() - cache_stat.st_mtime
# st_time can have a greater precision than time, removing
# float precision makes sure age will never be a negative
# number.
age = int(time.time()) - int(cache_stat.st_mtime)
else:
# if filelist does not exists yet, mark it as expired
age = opts.get('fileserver_list_cache_time', 20) + 1

View file

@ -693,14 +693,12 @@ def refresh_db(**kwargs):
# Cache repo-ng locally
log.info('Fetching *.sls files from {0}'.format(repo_details.winrepo_source_dir))
ret = __salt__['cp.cache_dir'](
__salt__['cp.cache_dir'](
path=repo_details.winrepo_source_dir,
saltenv=saltenv,
include_pat='*.sls',
exclude_pat=r'E@\/\..*?\/' # Exclude all hidden directories (.git)
)
log.debug("refresh_db - Return from cache_dir %s", repr(ret))
return genrepo(saltenv=saltenv, verbose=verbose, failhard=failhard)

View file

@ -75,8 +75,6 @@ class WinPKGTest(ModuleCase):
locale: en_US
reboot: False
'''))
fp_.flush()
os.fsync(fp_.fileno())
# now check if curl is also in cache and repo query
pkgs.append('curl')
for pkg in pkgs: