test: Extent timeout in assert_state_match

In the genconf test, we should wait extra time after `nmcli c reload`.
Extending to timeout of `assert_state_match` to 50 seconds.

Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
Gris Ge
2022-09-23 12:02:18 +08:00
committed by Fernando Fernández Mancera
parent dccc64827a
commit f6e5cd4d75

View File

@ -33,7 +33,7 @@ from libnmstate.schema import OvsDB
from . import statelib from . import statelib
RETRY_COUNT = 5 RETRY_COUNT = 100
def assert_state(desired_state_data): def assert_state(desired_state_data):
@ -61,7 +61,9 @@ def assert_state_match(desired_state_data):
desired_state, current_state = _prepare_state_for_verify( desired_state, current_state = _prepare_state_for_verify(
desired_state_data desired_state_data
) )
if not desired_state.match(current_state): if desired_state.match(current_state):
return
elif i == RETRY_COUNT - 1:
print( print(
"desired miss match with current, retrying, " "desired miss match with current, retrying, "
f"desire {desired_state.state}" f"desire {desired_state.state}"
@ -70,11 +72,9 @@ def assert_state_match(desired_state_data):
"desired miss match with current, retrying, " "desired miss match with current, retrying, "
f"current {current_state.state}" f"current {current_state.state}"
) )
assert desired_state.match(current_state)
else:
time.sleep(0.5) time.sleep(0.5)
desired_state, current_state = _prepare_state_for_verify(
desired_state_data
)
assert desired_state.match(current_state)
def assert_mac_address(state, expected_mac=None): def assert_mac_address(state, expected_mac=None):