test(gates): sequence the two-client remote-shadow gate with harness signals

Imported from the codex worktree's uncommitted work
(C:/Users/erikn/.codex/worktrees/bd98/acdream on
codex/atmospheric-rendering-campaign), on top of its 8b7b601b.

The remote-player shadow gate ran two clients on fixed sleeps, so the
observer could move before the primary had taken its 'before' screenshot,
or the primary could take its 'after' shot before the observer had moved.
Now the harness publishes named signal files into each client's artifact
directory and the routes block on them:

- IRetailUiAutomationRuntime.TryIsAutomationSignalPublished, implemented
  by WorldLifecycleAutomationController over <artifactDir>/signals/
  <name>.signal (names validated by AutomationArtifactName, so no path
  escape).
- 'wait signal <name> [timeoutMs]' in RetailUiAutomationScriptRunner.
- run-connected-render-pack-remote-player-gate.ps1 publishes
  'primary-before' to the observer after the primary's before-shot
  completes, then 'observer-moved' to the primary after the observer's
  remote-observer-moved checkpoint.
- Both routes teleport with an explicit heading and wait 12 s to settle.

Build green; the three touched App test classes pass 58/58 including the
two new signal tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-22 17:44:13 +02:00
parent 8b7b601b32
commit c51b07ef95
8 changed files with 189 additions and 10 deletions

View file

@ -121,6 +121,21 @@ function Stop-ExactClient {
}
}
function Publish-ClientSignal {
param(
[Parameter(Mandatory = $true)][string]$ClientRoot,
[Parameter(Mandatory = $true)][string]$Name
)
if ($Name -notmatch '^[A-Za-z0-9_-]{1,80}$') {
throw "invalid automation signal name '$Name'"
}
$signalDirectory = Join-Path $ClientRoot 'signals'
$null = New-Item -ItemType Directory -Force -Path $signalDirectory
Assert-ConnectedGateNoReparsePoint $signalDirectory
Set-Content -Encoding ascii -LiteralPath `
(Join-Path $signalDirectory "$Name.signal") -Value 'published'
}
function Read-StatusEvents {
param([Parameter(Mandatory = $true)][string]$Path)
if (-not (Test-Path -LiteralPath $Path -PathType Leaf)) {
@ -240,7 +255,8 @@ try {
-RedirectStandardOutput $observerStdout `
-RedirectStandardError $observerStderr -PassThru
Wait-ForLogPattern $observer $observerStdout 'live: in world' $LoginTimeoutSeconds
Wait-ForLogPattern $observer $observerStdout 'live: teleport materialized' 90
Wait-ForLogPattern $observer $observerStdout `
'[world-gate] checkpoint name=remote-observer-ready' 120
$primaryStdout = Join-Path $primaryRoot 'client.stdout.log'
$primaryStderr = Join-Path $primaryRoot 'client.stderr.log'
@ -251,6 +267,12 @@ try {
-RedirectStandardOutput $primaryStdout `
-RedirectStandardError $primaryStderr -PassThru
Wait-ForLogPattern $primary $primaryStdout 'live: in world' $LoginTimeoutSeconds
Wait-ForLogPattern $primary $primaryStdout `
'[world-gate] screenshot-complete name=remote-player-before' 120
Publish-ClientSignal $observerRoot 'primary-before'
Wait-ForLogPattern $observer $observerStdout `
'[world-gate] checkpoint name=remote-observer-moved' 60
Publish-ClientSignal $primaryRoot 'observer-moved'
Wait-ForLogPattern $primary $primaryStdout `
'[world-gate] screenshot-complete name=remote-player-after' 120
Wait-ForLogPattern $primary $primaryStdout `