MDL-60555 core_search: Change unit tests to use fake time

Using real time caused rare failures. I've changed it to use fake
measurement for the indexing timeouts, which were unit-tested.
This commit is contained in:
sam marshall
2017-10-31 14:48:09 +00:00
parent 849405177f
commit 82735dec4d
5 changed files with 56 additions and 13 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ abstract class engine {
// Stop if we have exceeded the time limit (and there are still more items). Always
// do at least one second's worth of documents otherwise it will never make progress.
if ($lastindexeddoc !== $firstindexeddoc &&
!empty($options['stopat']) && microtime(true) >= $options['stopat']) {
!empty($options['stopat']) && manager::get_current_time() >= $options['stopat']) {
$partial = true;
break;
}