Browse code

Merge pull request #39878 from thaJeztah/cut_the_tail

hack/ci/windows.ps1: stop tailing logs after stopping the daemon

Tibor Vass authored on 2019/09/12 02:03:11
Showing 1 changed files
... ...
@@ -608,7 +608,8 @@ Try {
608 608
 
609 609
     # Start tailing the daemon under test if the command is installed
610 610
     if ($null -ne (Get-Command "tail" -ErrorAction SilentlyContinue)) {
611
-        $tail = start-process "tail" -ArgumentList "-f $env:TEMP\dut.out" -ErrorAction SilentlyContinue
611
+        Write-Host -ForegroundColor green "INFO: Start tailing logs of the daemon under tests"
612
+        $tail = Start-Process "tail" -ArgumentList "-f $env:TEMP\dut.out" -PassThru -ErrorAction SilentlyContinue
612 613
     }
613 614
 
614 615
     # Verify we can get the daemon under test to respond 
... ...
@@ -942,6 +943,12 @@ Try {
942 942
         Remove-Item "$env:TEMP\docker.pid" -force -ErrorAction SilentlyContinue
943 943
     }
944 944
 
945
+    # Stop the tail process (if started)
946
+    if ($null -ne $tail) {
947
+        Write-Host -ForegroundColor green "INFO: Stop tailing logs of the daemon under tests"
948
+        Stop-Process -InputObject $tail -Force
949
+    }
950
+
945 951
     Write-Host -ForegroundColor Green "INFO: executeCI.ps1 Completed successfully at $(Get-Date)."
946 952
 }
947 953
 Catch [Exception] {