Skip to content

Commit 6c00501

Browse files
authored
Add force teardown step in Windows concurrency test
Added a teardown step to forcefully terminate lingering daemon processes and clean up the temporary directory after the run.
1 parent df9d61d commit 6c00501

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/windows-concurrency-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ jobs:
7171
} else {
7272
Write-Error "Could not find daemon log in $env:TEMP\omnipkg"
7373
}
74+
75+
# --- ADD THIS TEARDOWN STEP ---
76+
- name: Force Teardown After Run 2
77+
if: always()
78+
shell: pwsh
79+
run: |
80+
Write-Host "Forcefully terminating any lingering daemon processes..."
81+
# Find the PID from the file and kill it. taskkill is robust.
82+
$pidPath = "$env:TEMP\omnipkg\${{ env.OMNIPKG_ENV_ID }}\omnipkg_daemon.pid"
83+
if (Test-Path $pidPath) {
84+
$pid = Get-Content $pidPath
85+
taskkill /F /PID $pid
86+
}
87+
Write-Host "Removing temp directory to ensure clean state for next run..."
88+
Remove-Item -Path "$env:TEMP\omnipkg\${{ env.OMNIPKG_ENV_ID }}" -Recurse -Force -ErrorAction SilentlyContinue
7489
7590
- name: Run Demo Again (Verify Caching)
7691
shell: cmd
@@ -82,6 +97,21 @@ jobs:
8297
shell: pwsh
8398
run: type "$env:TEMP\omnipkg\omnipkg_daemon.log"
8499

100+
# --- ADD THIS TEARDOWN STEP ---
101+
- name: Force Teardown After Run 2
102+
if: always()
103+
shell: pwsh
104+
run: |
105+
Write-Host "Forcefully terminating any lingering daemon processes..."
106+
# Find the PID from the file and kill it. taskkill is robust.
107+
$pidPath = "$env:TEMP\omnipkg\${{ env.OMNIPKG_ENV_ID }}\omnipkg_daemon.pid"
108+
if (Test-Path $pidPath) {
109+
$pid = Get-Content $pidPath
110+
taskkill /F /PID $pid
111+
}
112+
Write-Host "Removing temp directory to ensure clean state for next run..."
113+
Remove-Item -Path "$env:TEMP\omnipkg\${{ env.OMNIPKG_ENV_ID }}" -Recurse -Force -ErrorAction SilentlyContinue
114+
85115
- name: Run Demo Again (Verify Caching)
86116
shell: cmd
87117
run: omnipkg demo 8 --non-interactive

0 commit comments

Comments
 (0)