diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-04 10:57:50 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-09-04 10:57:50 +0200 |
| commit | db3d3258649c9bf1d1758d681eec062278497c62 (patch) | |
| tree | 18c05bc0fb4dd60ec5f54a809576ad090a581759 /scripts | |
| parent | ed1f619f89df0f911918b13a07f6df2cbca0a956 (diff) | |
| download | vyos-build-db3d3258649c9bf1d1758d681eec062278497c62.tar.gz vyos-build-db3d3258649c9bf1d1758d681eec062278497c62.zip | |
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.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-qemu-install | 23 |
1 files changed, 17 insertions, 6 deletions
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 |
