Skip to content

FLT-322 sync-push fix 2 — Cedric

Partially repaired; runtime verification blocked. No worktree commit or push. Tests used local bare origins, GIT_ALLOW_PROTOCOL=file, isolated FORGE_SMOKE_HOME, and -SkipPeers -SkipMacs; no fleet machine was targeted.

Changes

  • Production encoding defect: prepended the missing UTF-8 BOM without changing existing bytes or non-ASCII text. Byte check output: BOM: EF BB BF.
  • Test defect: changed --git-dir=$fx.Origin to --git-dir $fx.Origin. Argument-binding probe showed the former expands the entire fixture object plus literal .Origin: --git-dir=@{Root=...; Origin=...; Seed=...; Clone=...; Home=...}.Origin. The failure was not actual path length.
  • Added first test parses and runs under Windows PowerShell 5.1: BOM check plus actual hidden powershell -NoProfile -NonInteractive -File ... -SkipPeers -SkipMacs -NoPush against a real temporary repo, asserting exit 0, no parser errors, and sync-only output. Helper accepts an explicit child host.

Actual receipts

Ran the original test file using installed Pester 6, hidden, redirected to files, bounded by WaitForExit(600000) with tree-kill on timeout. No execution-policy override.

Import-Module 'C:/Users/fives/OneDrive/Documents/PowerShell/Modules/Pester/6.0.0/Pester.psd1'
$c = New-PesterConfiguration
$c.Run.Path = 'tests/sync-push-shadow.Tests.ps1'
$c.Run.Exit = $true
$c.TestRegistry.Enabled = $false
$c.Output.Verbosity = 'Detailed'
$env:FORGE_SMOKE_REAL_BIN = 'C:/Users/fives/source/repos/fleet-harness-wt/WT-0cdb-FLT-322/src/Forge.Gates.Smoke.Cli/bin/Release/net10.0/forge-smoke.exe'
$env:FRS_TEST_HOST = 'powershell'
Invoke-Pester -Configuration $c

Before restoring BOM, filtered with $c.Filter.FullName = '*parses and runs under Windows PowerShell 5.1':

Pester exit: 1
Expected: '239 187 191'
But was:  '60 35 13'
Tests completed in 2.76s
Tests Passed: 0, Failed: 1, Skipped: 0, Inconclusive: 0, NotRun: 20

After both fixes, full Windows PowerShell child-host run:

Pester exit: 21
File C:\Users\fives\source\repos\fleet-repo-sync-wt\WT-0cdb-FLT-322\sync-push.ps1 cannot be loaded running
scripts is disabled on this system.
    + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnauthorizedAccess
Tests completed in 33.56s
Tests Passed: 0, Failed: 21, Skipped: 0, Inconclusive: 0, NotRun: 0

Exact refused call: hidden powershell -NoProfile -NonInteractive -File "C:\Users\fives\source\repos\fleet-repo-sync-wt\WT-0cdb-FLT-322\sync-push.ps1" -RepoPath <temporary clone> -SkipPeers -SkipMacs .... First test passed BOM assertion, then failed child exit. No integration success established.

Stopped further tests per brief. pwsh: not run. Regression suite: not run. Regression line 65 also launches -ExecutionPolicy Bypass; left unchanged. Attempted process inspection to stop the finishing run received Get-CimInstance Win32_Process -Filter "Name='pwsh.exe'": Access denied; the final log confirms completion.

Logs: C:\Users\fives\AppData\Local\Temp\flt322-fix2\{red,powershell}.{stdout,stderr}.log. Both hosts and regression still need successful verification in an allowed environment.

Remaining delay risk

Explicit helper waits total 22 seconds (verify 5, publish 15, two tree-kills at 1 each). No proven 24-second wall ceiling: synchronous Git, process creation/kill and filesystem operations can stall longer. Timeout cleanup and detached-grandchild behavior remain unverified here. Fix 2 changed no production behavior beyond encoding.