fix(agent99): scope SigNoz SCP process receipt
All checks were successful
CD Pipeline / select-latest-carrier (push) Successful in 56s
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m41s
CD Pipeline / revalidate-deploy-carrier (push) Successful in 41s
CD Pipeline / build-and-deploy (push) Successful in 15m2s
CD Pipeline / revalidate-post-deploy-carrier (push) Successful in 39s
CD Pipeline / post-deploy-checks (push) Successful in 4m45s
All checks were successful
CD Pipeline / select-latest-carrier (push) Successful in 56s
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m41s
CD Pipeline / revalidate-deploy-carrier (push) Successful in 41s
CD Pipeline / build-and-deploy (push) Successful in 15m2s
CD Pipeline / revalidate-post-deploy-carrier (push) Successful in 39s
CD Pipeline / post-deploy-checks (push) Successful in 4m45s
This commit is contained in:
@@ -501,16 +501,16 @@ function Invoke-Agent99SignozToolchainScp {
|
|||||||
$stderrPath = Join-Path $env:TEMP "agent99-signoz-toolchain-scp-$token.err"
|
$stderrPath = Join-Path $env:TEMP "agent99-signoz-toolchain-scp-$token.err"
|
||||||
$script:TransientTransportOutputUsed = $true
|
$script:TransientTransportOutputUsed = $true
|
||||||
try {
|
try {
|
||||||
$process = Start-Process -FilePath "scp.exe" -ArgumentList $arguments `
|
$scpProcess = Start-Process -FilePath "scp.exe" -ArgumentList $arguments `
|
||||||
-NoNewWindow -RedirectStandardOutput $stdoutPath `
|
-NoNewWindow -RedirectStandardOutput $stdoutPath `
|
||||||
-RedirectStandardError $stderrPath -PassThru
|
-RedirectStandardError $stderrPath -PassThru
|
||||||
if (-not $process.WaitForExit(180000)) {
|
if (-not $scpProcess.WaitForExit(180000)) {
|
||||||
try { & taskkill.exe /PID $process.Id /T /F 2>&1 | Out-Null } catch {}
|
try { & taskkill.exe /PID $scpProcess.Id /T /F 2>&1 | Out-Null } catch {}
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
$process.WaitForExit() | Out-Null
|
$scpProcess.WaitForExit() | Out-Null
|
||||||
$process.Refresh()
|
$scpProcess.Refresh()
|
||||||
return [bool]($process.HasExited -and [int]$process.ExitCode -eq 0)
|
return [bool]($scpProcess.HasExited -and [int]$scpProcess.ExitCode -eq 0)
|
||||||
} finally {
|
} finally {
|
||||||
Remove-Item -LiteralPath $stdoutPath, $stderrPath -Force -ErrorAction SilentlyContinue
|
Remove-Item -LiteralPath $stdoutPath, $stderrPath -Force -ErrorAction SilentlyContinue
|
||||||
if ((Test-Path -LiteralPath $stdoutPath) -or (Test-Path -LiteralPath $stderrPath)) {
|
if ((Test-Path -LiteralPath $stdoutPath) -or (Test-Path -LiteralPath $stderrPath)) {
|
||||||
|
|||||||
@@ -168,6 +168,23 @@ def test_entrypoint_uses_typed_stdout_without_windows_process_exit_code() -> Non
|
|||||||
assert "taskkill.exe /PID $process.Id /T /F" in transport
|
assert "taskkill.exe /PID $process.Id /T /F" in transport
|
||||||
|
|
||||||
|
|
||||||
|
def test_toolchain_scp_uses_scoped_bounded_process_exit_readback() -> None:
|
||||||
|
source = ENTRYPOINT.read_text(encoding="utf-8")
|
||||||
|
transport = source[
|
||||||
|
source.index("function Invoke-Agent99SignozToolchainScp") : source.index(
|
||||||
|
"function New-Agent99SignozLockedRemoteCommand"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
assert '$scpProcess = Start-Process -FilePath "scp.exe"' in transport
|
||||||
|
assert "$scpProcess.WaitForExit(180000)" in transport
|
||||||
|
assert "taskkill.exe /PID $scpProcess.Id /T /F" in transport
|
||||||
|
assert "$scpProcess.WaitForExit()" in transport
|
||||||
|
assert "$scpProcess.Refresh()" in transport
|
||||||
|
assert "$scpProcess.HasExited -and [int]$scpProcess.ExitCode -eq 0" in transport
|
||||||
|
assert "$process.ExitCode" not in source
|
||||||
|
|
||||||
|
|
||||||
def test_entrypoint_preflight_has_explicit_credential_and_artifact_state_contracts() -> (
|
def test_entrypoint_preflight_has_explicit_credential_and_artifact_state_contracts() -> (
|
||||||
None
|
None
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user