3 final class HarbormasterSleepBuildStepImplementation
4 extends HarbormasterBuildStepImplementation
{
6 public function getName() {
10 public function getGenericDescription() {
11 return pht('Sleep for a specified number of seconds.');
15 public function getBuildStepGroupKey() {
16 return HarbormasterTestBuildStepGroup
::GROUPKEY
;
19 public function getDescription() {
21 'Sleep for %s seconds.',
22 $this->formatSettingForDescription('seconds'));
25 public function execute(
26 HarbormasterBuild
$build,
27 HarbormasterBuildTarget
$build_target) {
29 $settings = $this->getSettings();
31 $target = time() +
$settings['seconds'];
33 // Use $build_update so that we only reload every 5 seconds, but
34 // the sleep mechanism remains accurate.
37 while (time() < $target) {
40 if ($build_update <= 0) {
44 if ($this->shouldAbort($build, $build_target)) {
45 throw new HarbormasterBuildAbortedException();
53 public function getFieldSpecifications() {
56 'name' => pht('Seconds'),
59 'caption' => pht('The number of seconds to sleep for.'),