Commit e0490037 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactored some tests waiting for set time

parent 08e4da86
......@@ -779,7 +779,10 @@ sub wait_request {
my @req = _list_requests();
rvd_back->_process_requests_dont_fork($debug) if !$background;
for my $req_id ( @req ) {
my $req = Ravada::Request->open($req_id);
my $req;
eval { $req = Ravada::Request->open($req_id) };
next if $@ && $@ =~ /I can't find id=$req_id/;
die $@ if $@;
next if $skip{$req->command};
if ( $req->status ne 'done' ) {
diag("Waiting for request ".$req->id." ".$req->command." ".$req->status
......
......@@ -37,7 +37,7 @@ for my $vm_name ( @{rvd_front->list_vm_types}) {
next if !$domain->can_hybernate();
for my $fork ( 0, 1 ) {
my $fork = 0;
$domain->start($USER) if !$domain->is_active;
for ( 1 .. 10 ) {
last if $domain->is_active;
......@@ -57,8 +57,11 @@ for my $vm_name ( @{rvd_front->list_vm_types}) {
}
wait_request( background => $fork );
is($req->status ,'done');
is($req->error,'');
$domain = rvd_back->search_domain($domain->name);
is($domain->is_active,0);
is($domain->is_active,0,"Expecting domain ".$domain->name." not active , fork=$fork");
$domain->start($USER) if !$domain->is_active;
if (!$domain->is_active) {
......@@ -68,8 +71,6 @@ for my $vm_name ( @{rvd_front->list_vm_types}) {
is($domain->is_active,1);
}# for my $fork
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment