fix(agent99): serialize cross-process SSH transport
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 4m7s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 0s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 1m21s
CD Pipeline / build-and-deploy (push) Successful in 4m46s
CD Pipeline / post-deploy-checks (push) Successful in 2m39s

This commit is contained in:
ogt
2026-07-11 00:14:53 +08:00
parent 3b8bdcea80
commit ca252d3393
8 changed files with 209 additions and 79 deletions

View File

@@ -118,3 +118,21 @@ def test_agent99_bounds_stale_ssh_processes_without_touching_tunnels() -> None:
"staleMinutes": 15,
"hardStaleMinutes": 60,
}
def test_agent99_serializes_ssh_across_scheduled_task_processes() -> None:
source = CONTROL.read_text(encoding="utf-8")
config = json.loads((ROOT / "agent99.config.99.example.json").read_text())
assert "function Enter-AgentSshTransportLock" in source
assert "[IO.FileShare]::None" in source
assert '"ssh-transport.lock"' in source
invoke_ssh = source[source.index("function Invoke-SshText") :]
assert "Enter-AgentSshTransportLock" in invoke_ssh
assert "Exit-AgentSshTransportLock" in invoke_ssh
assert "ssh_transport_lock_failed" in source
assert config["sshTransport"] == {
"serialized": True,
"lockTimeoutSeconds": 90,
"lockPollMilliseconds": 200,
}