Commit 142c92cc authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(test): check if shutdown requests exists

parent 7ac07ae5
...@@ -42,17 +42,13 @@ sub test_run_timeout { ...@@ -42,17 +42,13 @@ sub test_run_timeout {
is($clone->run_timeout(),$timeout); is($clone->run_timeout(),$timeout);
$clone->start(user => $USER); $clone->start(user => $USER);
is(scalar($clone->list_requests(1)),2) or exit; my @requests = $clone->list_requests(1);
my ($req) = grep { $_->command eq 'shutdown' } @requests;
is($clone->is_active,1); ok($req, "Expecting shutdown requested ".Dumper($req,[map { [$_->command, $_->at_time] } @requests])) and do {
rvd_back->_process_all_requests_dont_fork(); is($req->args('id_domain'), $clone->id);
is($clone->is_active,1); my $at = $req->at_time();
for ( 1 .. $timeout + 60 ) { ok($at > time(),"Expecting at in the future ".($at - time));
last if !$clone->is_active || ! scalar($clone->list_requests(1)); };
sleep 1;
rvd_back->_process_all_requests_dont_fork();
}
is($clone->is_active,0, "Expecting ".$clone->name." timed out shutdown") or exit;
$clone->remove(user_admin); $clone->remove(user_admin);
$domain->remove(user_admin); $domain->remove(user_admin);
......
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