Skip to content

ci: read the simulator verdict from the device log when the console loses it - #15

Merged
sbokatuk merged 1 commit into
mainfrom
ci/simulator-verdict-race
Oct 31, 2026
Merged

sbokatuk merged 1 commit into
mainfrom
ci/simulator-verdict-race

Conversation

@sbokatuk

Copy link
Copy Markdown
Owner

Problem

The simulator checks can fail on a run where every check passed. DatadogNet PR 26 fixed this in DatadogNet, and this repo's runner has the same exposure: it greps the simctl launch --console-pty capture for FFMPEGKIT_E2E_DONE PASS, and the app exits straight after printing that line. simctl can stop relaying with the last lines undelivered, which is what happened in run 41110146674.

It's the same code path as the DatadogNet failure. I didn't search this repo's run history for a past occurrence.

Fix

Only .github/scripts/run-simulator-tests.sh changes, with the same logic as DatadogNet PR 26.

  • The console stream stays the first source. The verdict is read as PASS, FAIL or nothing, instead of only looking for PASS.
  • With no verdict on the console, the script reads the app's PASS, FAIL and FFMPEGKIT_E2E_DONE lines from the unified log, up to three times, and appends them to simulator-tests.log. Only then can it fail. A recovered verdict raises a ::warning::, so the race stays visible.
  • A real FFMPEGKIT_E2E_DONE FAIL still fails, from either source.
  • Every log query starts at this launch (--start @<unix time>) rather than --last 2m, so a PASS left by an earlier local run can't stand in for this one.

Test report

This repo's real verdict code, from echo "==> running" to the end of the script, ran against recorded console and log fixtures through a fake xcrun that honours the time bound, process name and BEGINSWITH prefixes. Marker FFMPEGKIT_E2E_DONE, process FFmpegKit.iOS.DeviceTests, the latter matching the device test project's name.

Scenario Expected Result
Current script, console lost the verdict fails (the bug) exit 1
Intact console, passing app (CRLF, as from the real pty) passes, log not used exit 0
Console lost the verdict, passing app passes, warns exit 0, one log query, ::warning::
Same, but the log only has the line on the second query passes exit 0, two queries
Intact console, real failure, stale PASS in the log fails exit 1
Console lost the verdict, real failure fails, names the check exit 1, FAIL line in the uploaded log
App reported nothing, stale PASS from an earlier launch fails exit 1, after three queries
PASS from another process fails exit 1
Another repo's marker fails exit 1
NUL byte in the console stream passes exit 0 (grep -a)

The harness catches a broken port: on SFMCSDK.Net, dropping -a, using --last 2m, reading only PASS and using a wrong process name each failed the matrix.

The same logic ran end to end on real iOS 26.5 and 26.0 simulators in DatadogNet PR 26, where a real app printed real verdicts through a truncated console.

Not covered

  • This repo's app wasn't run on a simulator with this change.
  • This PR's CI covers the normal path only, because the fallback runs only when the race fires.
  • The race itself has not been reproduced on demand. The evidence that it happens is run 41110146674.

🤖 Generated with Claude Code

The runner failed any run whose console capture had no passing verdict, but
simctl can stop relaying when the app exits, with the last lines undelivered.
DatadogNet run 41110146674 failed that way with every check passing, and the
stream was about two seconds behind the app, so a short wait in the app would
not reliably close the gap.

Read PASS or FAIL from the console first, and fall back to the unified log only
when the console has no verdict, so a real failure still fails from either
source. Start every log query at this launch instead of --last 2m, so a PASS
left by an earlier local run cannot stand in for this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 31, 2026 07:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@sbokatuk
sbokatuk merged commit 876a50a into main Oct 31, 2026
7 checks passed
@sbokatuk
sbokatuk deleted the ci/simulator-verdict-race branch October 31, 2026 16:08

This branch was successfully deployed

1 active deployment
nuget.org — b5605413 Deployed Oct 31, 2026 by sbokatuk via publish beta to nuget.org #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants