Skip to content

Commit 1a1d980

Browse files
authored
Wait for Dumps (#4887)
* Wait for Dumps * copy/paste fix * fixes
1 parent 65a2523 commit 1a1d980

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/run-executable.ps1

+11-1
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@ function Wait-Executable($Exe) {
382382
LogErr "Process had nonzero exit code: $($Exe.Process.ExitCode)"
383383
$KeepOutput = $true
384384
}
385+
# Wait up to 30 seconds for files to appear in $LogDir if $AZP is set.
386+
if ($AZP) {
387+
$Elapsed = 0
388+
$Timeout = 30
389+
while ($Elapsed -lt $Timeout -and (Get-ChildItem -Path $LogDir | Measure-Object).Count -eq 0) {
390+
Start-Sleep -Seconds 1
391+
$Elapsed++
392+
}
393+
}
385394
$DumpFiles = (Get-ChildItem $LogDir) | Where-Object { $_.Extension -eq ".dmp" }
386395
if ($DumpFiles) {
387396
LogErr "Dump file(s) generated"
@@ -462,7 +471,8 @@ function Wait-Executable($Exe) {
462471
Remove-Item $LogDir -Recurse -Force | Out-Null
463472
}
464473

465-
Log "Output available at $($LogDir)"
474+
Log "Output available at $LogDir"
475+
if ($AZP) { dir $LogDir }
466476

467477
} else {
468478
if ($LogProfile -ne "None") {

0 commit comments

Comments
 (0)