diff --git a/src/Orchestration/Adapter/DockerCLI.php b/src/Orchestration/Adapter/DockerCLI.php index cfdadc9..5e606db 100644 --- a/src/Orchestration/Adapter/DockerCLI.php +++ b/src/Orchestration/Adapter/DockerCLI.php @@ -116,6 +116,12 @@ public function getStats(string $container = null, array $filters = []): array if ($result !== 0) { throw new Orchestration("Docker Error: {$output}"); } + $dump = function ($value) { + $p = var_export($value, true); + $b = debug_backtrace(); + echo $b[0]['file'].':'.$b[0]['line'].' - '.$p."\n"; + }; + $dump($output); $lines = \explode("\n", $output); @@ -344,6 +350,13 @@ public function run(string $image, $vars = $parsedVariables; + $dump = function ($value) { + $p = var_export($value, true); + $b = debug_backtrace(); + echo $b[0]['file'].':'.$b[0]['line'].' - '.$p."\n"; + }; + $dump(implode(' ', $command)); + $time = time(); $result = Console::execute('docker run'. @@ -401,6 +414,13 @@ public function execute( $vars = $parsedVariables; + $dump = function ($value) { + $p = var_export($value, true); + $b = debug_backtrace(); + echo $b[0]['file'].':'.$b[0]['line'].' - '.$p."\n"; + }; + $dump(implode(' ', $command)); + $result = Console::execute('docker exec '.\implode(' ', $vars)." {$name} ".implode(' ', $command), '', $output, $timeout); if ($result !== 0) { diff --git a/tests/Orchestration/Base.php b/tests/Orchestration/Base.php index 2f8e1dd..9d83b02 100644 --- a/tests/Orchestration/Base.php +++ b/tests/Orchestration/Base.php @@ -493,8 +493,8 @@ public function testUsageStats(): void // This allows CPU-heavy load check $output = ''; - static::getOrchestration()->execute($containerId1, ['screen', '-d', '-m', "'stress --cpu 1 --timeout 5'"], $output); // Run in screen so it's background task - static::getOrchestration()->execute($containerId2, ['screen', '-d', '-m', "'stress --cpu 1 --timeout 5'"], $output); + static::getOrchestration()->execute($containerId1, ['screen', '-d', '-m', 'stress --cpu 1 --timeout 10'], $output); // Run in screen so it's background task + static::getOrchestration()->execute($containerId2, ['screen', '-d', '-m', 'stress --cpu 1 --timeout 10'], $output); // Set CPU stress-test start \sleep(1);