Skip to content

Commit 34f3cbc

Browse files
committed
add retries on activation of disk-watchdog service
Signed-off-by: Yann CARDAILLAC <[email protected]>
1 parent cc427d2 commit 34f3cbc

File tree

1 file changed

+14
-6
lines changed
  • tests/suites/os/tests/disk-watchdog

1 file changed

+14
-6
lines changed

tests/suites/os/tests/disk-watchdog/index.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,20 @@ const verify_service_enabled_and_active = async (context, link, test) => {
289289
);
290290
test.is(enabled.trim(), 'enabled', 'disk-watchdogd should be enabled');
291291

292-
const active = await context
293-
.get()
294-
.worker.executeCommandInHostOS(
295-
`systemctl is-active disk-watchdogd || true`,
296-
link,
297-
);
292+
// Retry checking service state in case it's still activating
293+
let active = '';
294+
for (let i = 0; i < 10; i++) {
295+
active = await context
296+
.get()
297+
.worker.executeCommandInHostOS(
298+
`systemctl is-active disk-watchdogd || true`,
299+
link,
300+
);
301+
if (active.trim() === 'active') {
302+
break;
303+
}
304+
await new Promise(r => setTimeout(r, 2000));
305+
}
298306
test.is(active.trim(), 'active', 'disk-watchdogd should be active');
299307
};
300308

0 commit comments

Comments
 (0)