From db3d3258649c9bf1d1758d681eec062278497c62 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 4 Sep 2026 10:57:50 +0200 Subject: Testsuite: T9276: RAID1 test sporadically fails due to timeout violation Re-partitioning a disk and adding it back to the array can take significantly longer then the default pexpect timeout of 30 seconds. --- scripts/check-qemu-install | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 85d6c024..4ad340fe 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -1603,24 +1603,35 @@ try: c.sendline('cat /proc/mdstat') c.expect(op_mode_prompt) + # Re-partitioning a disk and adding it back to the array can take + # significantly longer then the default pexpect timeout of 30 seconds + raid_timeout = 300 + # Upper limit we wait for the array to be fully re-synced + raid_sync_timeout = 900 + log.info('Re-format new RAID member') c.sendline('format by-id disk drive-hd1 like drive-hd2') c.sendline('yes') - c.expect(op_mode_prompt) + c.expect(op_mode_prompt, timeout=raid_timeout) log.info('Add member to RAID1 (md0)') c.sendline('add raid md0 by-id member drive-hd1-part3') - c.expect(op_mode_prompt) + c.expect(op_mode_prompt, timeout=raid_timeout) log.info('Now we need to wait for re-sync to complete') start_time = time.time() - timeout = 60 while True: - if (start_time + timeout) < time.time(): - break c.sendline('cat /proc/mdstat') - c.expect(op_mode_prompt) + # Once both members are up and in sync, mdstat reports "[2/2] [UU]" + index = c.expect([r'\[2/2\]\s+\[UU\]', op_mode_prompt], + timeout=raid_timeout) + if index == 0: + c.expect(op_mode_prompt, timeout=raid_timeout) + log.info('RAID1 re-sync completed') + break + if (start_time + raid_sync_timeout) < time.time(): + raise Exception('Timeout waiting for RAID1 re-sync to complete') time.sleep(20) # Reboot system with new primary RAID1 disk -- cgit v1.2.3