Skip to content

Commit

Permalink
Merge pull request #2711 from lluiscampos/MEN-7900-test-catch-bug
Browse files Browse the repository at this point in the history
MEN-7900: Improve test to catch bugs with the state machine hanging
  • Loading branch information
lluiscampos authored Jan 24, 2025
2 parents 180f7e4 + db83228 commit 26ca263
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/tests/test_state_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def class_persistent_enterprise_setup_client_state_scripts_update_module(
"Failure_in_Download_Enter_script",
{
"FailureScript": ["Download_Enter_12"],
"ExpectedStatus": None,
"ExpectedStatus": "failure",
"ScriptOrder": [
"Idle_Enter_08_testing",
"Idle_Enter_09",
Expand Down Expand Up @@ -907,12 +907,14 @@ def verify_script_log_correct(self, test_set, log_orig):

# Test cases with an expectation of success/failure shall do only 1 iteration
# Test cases with None expectation will loop through the error sequence in a loop, but still
# we want to make sure that it is reasonable (i.e. looping with the correct time intervals).
# For these cases we set a max. of 50 iterations to accomodate for slow running of the framework
# we want to make sure that it is reasonable.
# For these cases we set a min. of 4 iterations to ensure that the state machine is
# indeed looping and a max. of of 50 iterations to accommodate for slow running of the
# framework.
if test_set["ExpectedStatus"] is not None:
assert num_iterations == 1
else:
assert num_iterations < 50
assert num_iterations > 4 and num_iterations < 50

except:
logger.error(
Expand Down

0 comments on commit 26ca263

Please sign in to comment.