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:
parent
dccc64827a
commit
f6e5cd4d75
@ -33,7 +33,7 @@ from libnmstate.schema import OvsDB
|
||||
|
||||
from . import statelib
|
||||
|
||||
RETRY_COUNT = 5
|
||||
RETRY_COUNT = 100
|
||||
|
||||
|
||||
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_data
|
||||
)
|
||||
if not desired_state.match(current_state):
|
||||
if desired_state.match(current_state):
|
||||
return
|
||||
elif i == RETRY_COUNT - 1:
|
||||
print(
|
||||
"desired miss match with current, retrying, "
|
||||
f"desire {desired_state.state}"
|
||||
@ -70,11 +72,9 @@ def assert_state_match(desired_state_data):
|
||||
"desired miss match with current, retrying, "
|
||||
f"current {current_state.state}"
|
||||
)
|
||||
assert desired_state.match(current_state)
|
||||
else:
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user