mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2024-11-24 00:51:00 +00:00
do not assume Garage boots in 2sec during tests
This commit is contained in:
parent
40fa1242f0
commit
7ebed96b44
1 changed files with 19 additions and 6 deletions
|
@ -111,14 +111,27 @@ api_bind_addr = "127.0.0.1:{admin_port}"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup(&mut self) {
|
fn setup(&mut self) {
|
||||||
|
self.wait_for_boot();
|
||||||
|
self.setup_layout();
|
||||||
|
self.key = self.new_key("garage_test");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn wait_for_boot(&mut self) {
|
||||||
use std::{thread, time::Duration};
|
use std::{thread, time::Duration};
|
||||||
|
|
||||||
// Wait for node to be ready
|
// 60 * 2 seconds = 120 seconds = 2min
|
||||||
thread::sleep(Duration::from_secs(2));
|
for _ in 0..60 {
|
||||||
|
let termination = self
|
||||||
self.setup_layout();
|
.command()
|
||||||
|
.args(["status"])
|
||||||
self.key = self.new_key("garage_test");
|
.quiet()
|
||||||
|
.status()
|
||||||
|
.expect("Unable to run command");
|
||||||
|
if termination.success() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
thread::sleep(Duration::from_secs(2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_layout(&self) {
|
fn setup_layout(&self) {
|
||||||
|
|
Loading…
Reference in a new issue