Private GIT

Skip to content
Snippets Groups Projects
Commit bbba2795 authored by Kevin Duret's avatar Kevin Duret Committed by Kevin Duret
Browse files

test(acceptance): fix random fails on flexible downtime acceptance test (#6148)

parent 3098b280
Branches
Tags V4.2.0.01
No related merge requests found
......@@ -37,7 +37,7 @@ Feature: Downtime start and stop
Given a flexible downtime on a monitored element
And the flexible downtime is started
When the downtime duration is finished
Then the downtime is stopped
Then the flexible downtime is stopped
Scenario: Configure recurrent downtime
Given a recurrent downtime on an other timezone service
......
......@@ -198,6 +198,36 @@ class DowntimeStartAndStopContext extends CentreonContext
);
}
/**
* @Then the flexible downtime is stopped
*/
public function theFlexibleDowntimeIsStopped()
{
$this->spin(
function ($context) {
$finished = false;
$storageDb = $context->getStorageDatabase();
$res = $storageDb->query(
'SELECT d.downtime_id, d.actual_end_time ' .
'FROM downtimes d, hosts h, services s ' .
'WHERE h.host_id = d.host_id ' .
'AND s.service_id = d.service_id ' .
'AND h.name = "' . $context->host . '" ' .
'AND s.description = "' . $context->service . '" ' .
'AND d.actual_end_time IS NOT NULL ' .
'AND d.actual_end_time < ' . time()
);
if ($row = $res->fetch()) {
$finished = true;
}
return $finished;
},
'FLexible downtime is still running.',
30
);
}
/**
* @Given a downtime in configuration of a user in other timezone
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment