getServiceLocator()->get(TestSessionService::SERVICE_ID); $testSession = $testSessionService->getTestSession($deliveryExecution); // To calculate all TestVariables if ($testSession && $testSession->isRunning()) { $testSession->endTestSession(); } $this->getDeliveryStateService()->finish($deliveryExecution, [ 'reasons' =>[ 'category' => 'Technical' ], 'comment' => $isEndDate ? 'The assessment was automatically finished because end time expired.' : 'The assessment was automatically finished.' ]); $this->report->add(Report::createSuccess('Execution finished with success: ' . $executionId )); } }