Skip to content

Commit

Permalink
Split test into remote + local
Browse files Browse the repository at this point in the history
  • Loading branch information
Hook25 committed Nov 20, 2024
1 parent 6152d9f commit 0af5839
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion metabox/metabox/scenarios/restart/agent_respawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ class ResumeAfterFinishPreserveOutputRemote(Scenario):


@tag("resume", "manual", "regression")
class ResumePreservesRejectedJobsStateMap(Scenario):
class LocalResumePreservesRejectedJobsStateMap(Scenario):
"""
Check that the job_state_map survives both manual closure and restarts
"""

modes = ["local"]
launcher = "# no launcher"
steps = [
Start(),
Expand Down Expand Up @@ -198,3 +199,43 @@ class ResumePreservesRejectedJobsStateMap(Scenario):
# state map (as it was prior to this regression)
Expect("Do you want to submit 'upload to certification' report?"),
]


@tag("resume", "manual", "regression")
class RemoteResumePreservesRejectedJobsStateMap(Scenario):
"""
Check that the job_state_map survives both manual closure and restarts
This differs from Local because in remote the controller waits for the
agent to come back, we loose the output of the rebooting job and we don't
need to re-start the controller on reboot
"""

modes = ["remote"]
launcher = "# no launcher"
steps = [
Start(),
Expect("Select test plan"),
SelectTestPlan(
"2021.com.canonical.certification::checkbox-crash-then-reboot"
),
Send(keys.KEY_ENTER),
Expect("Press (T) to start"),
Send(keys.KEY_ENTER),
Expect("Crash Checkbox"),
Send(keys.KEY_DOWN + keys.KEY_SPACE),
Expect("[ ]"),
Send("T"),
Expect("Connection lost!"),
Expect("Do you want to submit 'upload to certification' report?"),
Signal(keys.SIGINT),
Start(),
# Part of the regression, fixing the job state map would make the
# re-bootstrapping of the session include the excluded job
ExpectNot("Crash Checkbox", timeout=0.1),
Expect("tar_file"),
# Here the session will try to re-generate the submission.json but it
# will fail if the info about the session is not complete in the job
# state map (as it was prior to this regression)
Expect("Do you want to submit 'upload to certification' report?"),
]

0 comments on commit 0af5839

Please sign in to comment.