Permalink
Browse files

Tuning timeouts in testing environment

Maximum backoffs of polling have to be taken into account when asking a process for graceful shutdown
  • Loading branch information...
1 parent 8b23399 commit 8bb11f5c243ebce834eaeadbc1c5c98815581b1d Giorgio Sironi committed Mar 9, 2016
View
@@ -11,7 +11,7 @@ use Onebip\Clock\SystemClock;
$cli = new Cli();
$cli->add('recruiter', new Option\TargetHost('target'));
-$cli->add('wait-strategy', new Option\WaitStrategy('backoff-to', '30s'));
+$cli->add('wait-strategy', new Option\WaitStrategy('backoff-to', '12800ms'));
$cli->add('memory-limit', new Option\MemoryLimit('memory-limit', '256MB'));
$cli->parse();
@@ -85,7 +85,7 @@ protected function stopProcessWithSignal(array $processAndPipes, $signal)
{
list($process, $pipes, $name) = $processAndPipes;
proc_terminate($process, $signal);
- Timeout::inSeconds(1, 'termination of worker')
+ Timeout::inSeconds(30, 'termination of process')
->until(function() use ($process) {
$status = proc_get_status($process);
return $status['running'] == false;
@@ -41,6 +41,13 @@ function($milliseconds) {
)
)))
->hook(Listener\collectFrequencies(function($actions) {
+ $actions = array_map(function($action) {
+ if (is_array($action)) {
+ return '(' . implode(',', $action) . ')';
+ } else {
+ return $action;
+ }
+ }, $actions);
return '[' . implode(',', $actions) . ']';
}))
->then(function($actions) {

0 comments on commit 8bb11f5

Please sign in to comment.