Skip to content

Commit

Permalink
tests: hup: rollback-altboot: replace while loop over SSH to speed up…
Browse files Browse the repository at this point in the history
… tests

The altboot test often hangs for a long time during the altboot test, after the DUT has booted into the old OS after the altboot failure - the check to see if the rollback systemd services have stopped hangs. This is an attempt to fix that, as I think there's some strange interaction going on with the while loop over ssh

Change-type: patch
Signed-off-by: Ryan Cooke <ryan@balena.io>
  • Loading branch information
rcooke-warwick committed Nov 28, 2024
1 parent 229a6ad commit 1aaf764
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions tests/suites/hup/tests/rollbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,26 @@ module.exports = {

await this.worker.rebootDut(this.link);

// system.waitForServiceState times out here for some reason, so just use shell
await this.worker.executeCommandInHostOS(
['while [ "$(systemctl is-active rollback-altboot)" != "inactive" ]',
'|| [ "$(systemctl is-active rollback-health)" != "inactive" ]; do sleep 1; done'
],
this.link,
);

await this.utils.waitUntil(async () => {
console.log(`Waiting for rollback-altboot service to be inactive...`)
let state = await this.worker.executeCommandInHostOS(
`systemctl is-active rollback-altboot || true`,
this.link
)
console.log(state)
return (state === "inactive");
})

await this.utils.waitUntil(async () => {
console.log(`Waiting for rollback-health service to be inactive...`)
let state = await this.worker.executeCommandInHostOS(
`systemctl is-active rollback-health || true`,
this.link
)
console.log(state)
return (state === "inactive");
})

await test.resolves(
this.utils.waitUntil(async () => {
return this.worker.executeCommandInHostOS(
Expand Down

0 comments on commit 1aaf764

Please sign in to comment.