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 22, 2024
1 parent b902bd0 commit f3c573b
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`,
this.link
)

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`,
this.link
)

return (state === "inactive");
})

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

0 comments on commit f3c573b

Please sign in to comment.