공개 런타임 프로브 복구 수정
This commit is contained in:
parent
527027b93d
commit
a73bcd248f
3 changed files with 92 additions and 4 deletions
|
|
@ -240,8 +240,15 @@ function Test-VoiceSidecarStack {
|
||||||
"--tts-language", "KR",
|
"--tts-language", "KR",
|
||||||
"--timeout-seconds", "5"
|
"--timeout-seconds", "5"
|
||||||
)
|
)
|
||||||
|
$previousErrorActionPreference = $ErrorActionPreference
|
||||||
|
try {
|
||||||
|
$ErrorActionPreference = "Continue"
|
||||||
& $Python @probeArgs 1>$null 2>$null
|
& $Python @probeArgs 1>$null 2>$null
|
||||||
return $LASTEXITCODE -eq 0
|
$probeExit = $LASTEXITCODE
|
||||||
|
} finally {
|
||||||
|
$ErrorActionPreference = $previousErrorActionPreference
|
||||||
|
}
|
||||||
|
return $probeExit -eq 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-BootLog "================ boot start ================"
|
Write-BootLog "================ boot start ================"
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,15 @@ function Test-VoiceSidecarReady {
|
||||||
"--tts-language", $MeloTtsLanguage,
|
"--tts-language", $MeloTtsLanguage,
|
||||||
"--timeout-seconds", "5"
|
"--timeout-seconds", "5"
|
||||||
)
|
)
|
||||||
|
$previousErrorActionPreference = $ErrorActionPreference
|
||||||
|
try {
|
||||||
|
$ErrorActionPreference = "Continue"
|
||||||
& $Python @probeArgs 1>$null 2>$null
|
& $Python @probeArgs 1>$null 2>$null
|
||||||
return $LASTEXITCODE -eq 0
|
$probeExit = $LASTEXITCODE
|
||||||
|
} finally {
|
||||||
|
$ErrorActionPreference = $previousErrorActionPreference
|
||||||
|
}
|
||||||
|
return $probeExit -eq 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function Wait-VoiceSidecarReady {
|
function Wait-VoiceSidecarReady {
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ INSTALLER_SOURCE = INSTALLER.read_text(encoding="utf-8")
|
||||||
BOOT_SOURCE = BOOT.read_text(encoding="utf-8")
|
BOOT_SOURCE = BOOT.read_text(encoding="utf-8")
|
||||||
BOOT_REGISTER_SOURCE = BOOT_REGISTER.read_text(encoding="utf-8")
|
BOOT_REGISTER_SOURCE = BOOT_REGISTER.read_text(encoding="utf-8")
|
||||||
HIDDEN_TRIGGER_SOURCE = HIDDEN_TRIGGER.read_text(encoding="utf-8")
|
HIDDEN_TRIGGER_SOURCE = HIDDEN_TRIGGER.read_text(encoding="utf-8")
|
||||||
|
START_SOURCE = START.read_text(encoding="utf-8")
|
||||||
RUNBOOK_SOURCE = RUNBOOK.read_text(encoding="utf-8")
|
RUNBOOK_SOURCE = RUNBOOK.read_text(encoding="utf-8")
|
||||||
LOCAL_DEVELOPMENT_SOURCE = LOCAL_DEVELOPMENT.read_text(encoding="utf-8")
|
LOCAL_DEVELOPMENT_SOURCE = LOCAL_DEVELOPMENT.read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
|
@ -264,6 +265,79 @@ if ($result.Detail -ne 'exact readiness probe failed') {
|
||||||
msg=f"stdout={completed.stdout}\nstderr={completed.stderr}",
|
msg=f"stdout={completed.stdout}\nstderr={completed.stderr}",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_boolean_sidecar_probes_survive_native_stderr_under_powershell_51(self) -> None:
|
||||||
|
powershell = shutil.which("powershell.exe")
|
||||||
|
python = shutil.which("python.exe")
|
||||||
|
if powershell is None or python is None:
|
||||||
|
self.skipTest("Windows PowerShell 5.1 and Python are required")
|
||||||
|
|
||||||
|
contracts = (
|
||||||
|
(
|
||||||
|
START_SOURCE[
|
||||||
|
START_SOURCE.index("function Test-VoiceSidecarReady") :
|
||||||
|
START_SOURCE.index("function Wait-VoiceSidecarReady")
|
||||||
|
].strip(),
|
||||||
|
"$result = Test-VoiceSidecarReady -Component 'stt'",
|
||||||
|
"start",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
BOOT_SOURCE[
|
||||||
|
BOOT_SOURCE.index("function Test-VoiceSidecarStack") :
|
||||||
|
BOOT_SOURCE.index('Write-BootLog "================ boot start')
|
||||||
|
].strip(),
|
||||||
|
"$result = Test-VoiceSidecarStack",
|
||||||
|
"boot",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
python_escaped = python.replace("'", "''")
|
||||||
|
probe_escaped = str(VOICE_PROBE).replace("'", "''")
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory() as temporary_directory:
|
||||||
|
for contract, invocation, role in contracts:
|
||||||
|
harness = Path(temporary_directory) / f"{role}-probe-contract.ps1"
|
||||||
|
harness.write_text(
|
||||||
|
"$ErrorActionPreference = 'Stop'\n"
|
||||||
|
+ f"$Python = '{python_escaped}'\n"
|
||||||
|
+ f"$VoiceSidecarProbe = '{probe_escaped}'\n"
|
||||||
|
+ f"$voiceSidecarProbe = '{probe_escaped}'\n"
|
||||||
|
+ "$WhisperPort = 1\n"
|
||||||
|
+ "$MeloTtsPort = 2\n"
|
||||||
|
+ "$WhisperModel = 'small'\n"
|
||||||
|
+ "$WhisperLanguage = 'ko'\n"
|
||||||
|
+ "$WhisperDevice = 'cpu'\n"
|
||||||
|
+ "$MeloTtsModel = 'melotts-korean'\n"
|
||||||
|
+ "$MeloTtsLanguage = 'KR'\n"
|
||||||
|
+ contract
|
||||||
|
+ "\n"
|
||||||
|
+ invocation
|
||||||
|
+ "\nif ($result) { throw 'unreachable sidecars were accepted' }\n",
|
||||||
|
encoding="utf-8-sig",
|
||||||
|
)
|
||||||
|
completed = subprocess.run(
|
||||||
|
[
|
||||||
|
powershell,
|
||||||
|
"-NoLogo",
|
||||||
|
"-NoProfile",
|
||||||
|
"-NonInteractive",
|
||||||
|
"-ExecutionPolicy",
|
||||||
|
"Bypass",
|
||||||
|
"-File",
|
||||||
|
str(harness),
|
||||||
|
],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
errors="replace",
|
||||||
|
timeout=30,
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
|
with self.subTest(role=role):
|
||||||
|
self.assertEqual(
|
||||||
|
completed.returncode,
|
||||||
|
0,
|
||||||
|
msg=f"stdout={completed.stdout}\nstderr={completed.stderr}",
|
||||||
|
)
|
||||||
|
|
||||||
def test_hidden_trigger_never_executes_a_workspace_script_directly(self) -> None:
|
def test_hidden_trigger_never_executes_a_workspace_script_directly(self) -> None:
|
||||||
for expected in (
|
for expected in (
|
||||||
"VignettePublicRuntimeWatchdog",
|
"VignettePublicRuntimeWatchdog",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue