mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix test_system flaky setup_teardown fn
This commit is contained in:
parent
99639ca5c9
commit
6c38c1a253
1 changed files with 9 additions and 1 deletions
|
@ -5,10 +5,12 @@ import shutil
|
|||
import signal
|
||||
import subprocess
|
||||
import textwrap
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
import salt.utils.files
|
||||
from salt.exceptions import CommandExecutionError
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.skip_unless_on_linux,
|
||||
|
@ -76,7 +78,13 @@ def setup_teardown_vars(file, service, system):
|
|||
file.remove("/etc/machine-info")
|
||||
|
||||
if _systemd_timesyncd_available_:
|
||||
res = service.start("systemd-timesyncd")
|
||||
try:
|
||||
res = service.start("systemd-timesyncd")
|
||||
except CommandExecutionError:
|
||||
# We possibly did too many restarts in too short time
|
||||
# Wait 10s (default systemd timeout) and try again
|
||||
time.sleep(10)
|
||||
res = service.start("systemd-timesyncd")
|
||||
assert res
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue