当前位置: 首页>>代码示例>>PHP>>正文


PHP ExecFuture::getWasKilledByTimeout方法代码示例

本文整理汇总了PHP中ExecFuture::getWasKilledByTimeout方法的典型用法代码示例。如果您正苦于以下问题:PHP ExecFuture::getWasKilledByTimeout方法的具体用法?PHP ExecFuture::getWasKilledByTimeout怎么用?PHP ExecFuture::getWasKilledByTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExecFuture的用法示例。


在下文中一共展示了ExecFuture::getWasKilledByTimeout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTimeoutTestShouldRunLessThan1Sec

 public function testTimeoutTestShouldRunLessThan1Sec()
 {
     // NOTE: This is partly testing that we choose appropriate select wait
     // times; this test should run for significantly less than 1 second.
     $future = new ExecFuture('sleep 32000');
     list($err) = $future->setTimeout(0.01)->resolve();
     $this->assertEqual(true, $err > 0);
     $this->assertEqual(true, $future->getWasKilledByTimeout());
 }
开发者ID:rwray,项目名称:libphutil,代码行数:9,代码来源:ExecFutureTestCase.php

示例2: run

 public function run()
 {
     $results = array();
     $build_start = microtime(true);
     $config_manager = $this->getConfigurationManager();
     if ($this->getEnableCoverage() !== false) {
         $command = $config_manager->getConfigFromAnySource('unit.engine.tap.cover');
     } else {
         $command = $config_manager->getConfigFromAnySource('unit.engine.tap.command');
     }
     $timeout = $config_manager->getConfigFromAnySource('unit.engine.tap.timeout');
     if (!$timeout) {
         $timeout = 15;
     }
     $future = new ExecFuture('%C', $command);
     $future->setTimeout($timeout);
     $result = new ArcanistUnitTestResult();
     $result->setName($command ? $command : 'unknown');
     try {
         list($stdout, $stderr) = $future->resolvex();
         $result->setResult(ArcanistUnitTestResult::RESULT_PASS);
         if ($this->getEnableCoverage() !== false) {
             $coverage = $this->readCoverage('coverage/cobertura-coverage.xml');
             $result->setCoverage($coverage);
         }
     } catch (CommandException $exc) {
         $result->setResult(ArcanistUnitTestResult::RESULT_FAIL);
         if ($future->getWasKilledByTimeout()) {
             print "Process stdout:\n" . $exc->getStdout() . "\nProcess stderr:\n" . $exc->getStderr() . "\nExceeded timeout of {$timeout} secs.\nMake unit tests faster.";
         } else {
             $result->setUserdata($exc->getStdout() . $exc->getStderr());
         }
     }
     $result->setDuration(microtime(true) - $build_start);
     $results[] = $result;
     return $results;
 }
开发者ID:rmaz,项目名称:arcanist,代码行数:37,代码来源:TAPTestEngine.php


注:本文中的ExecFuture::getWasKilledByTimeout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。