Repository navigation
[eas-cli] Show why a simulator session failed to start - #4693
Conversation
simulator:start only printed the session status when a session errored before it was ready. The reason is already on the session's job run, so fetch turtleJobRun.errors and print each message (and docs link) on its own line.
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4693 +/- ##
==========================================
+ Coverage 75.23% 75.30% +0.08%
==========================================
Files 1053 1053
Lines 52000 52191 +191
Branches 11345 11397 +52
==========================================
+ Hits 39118 39299 +181
- Misses 11894 11904 +10
Partials 988 988 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s for unknown errors Fetch job run errors with a separate query when a session fails instead of on every poll of the shared session query. When the job run only reports an unknown error, print the failed step errors from its logs. Also show the errors when a session fails after it is ready.
|
|
||
| async function fetchJobRunLogErrorsAsync(logFileUrl: string): Promise<string[]> { | ||
| try { | ||
| const response = await fetch(logFileUrl); |
There was a problem hiding this comment.
Non-blocking: explicit timeout
There was a problem hiding this comment.
This was on the log download, which is no longer in this PR. The errors query that replaced it now has an explicit 10s deadline (JOB_RUN_ERRORS_TIMEOUT_MS, combined with the Ctrl+C signal). The log download moved to #4694, where it has its own 10s timeout and a 20 MiB size limit.
Drop the job run log fallback from this change, which printed unmasked err.message lines, read logs for stopped sessions and had no timeout or size limit. The bounded, masked log fallback lands in the simulator:get follow-up.
Give the lookup a 10s deadline and the session's Ctrl+C signal, and cancel its request by unsubscribing from urql, so it can't hold up stopping the session. Don't retry it or print the transient-error message, since it's best-effort. Cap each error message at 500 characters.
|
✅ Thank you for adding a changeset! |
Why
When a simulator session fails,
eas simulator:startprints only the session status and a link:The reason is already on the session's job run. In this case
turtleJobRun.errorsheldEAS_IOS_SIMULATOR_NOT_FOUNDwithNo available iOS Simulator is named "iPhone 16 Pro"…. To find it, you had to open the session page and expand the failed step.How
DeviceRunSessionQuery.jobRunErrorsByIdAsyncfetches the job run'serrors { errorCode message docsUrl }. It runs only once a session has failed, so the sharedbyIdAsyncquery, which runs on every poll and backssimulator:getandsimulator:control, is unchanged. If it fails, the CLI prints the old message.docsUrl.Simulator session X errored.generated.tsonly adds the new query's types, matching codegen output exactly.After, for an unknown device on iOS:
For failures without a specific error code, this PR prints the job run's own message (for example "Unknown error. See logs for more information."). Reading the failed step's cause from the job run logs is in #4694, which bounds the download and prints only the masked log message.
Test Plan
npx jest src/commands/simulator src/graphql/queries/__tests__/DeviceRunSessionQuery-test.ts: 204 tests pass. The new tests assert the exact error message for:DeviceRunSessionQuery-test.tsruns a real urql client against a loopback server and checks that:yarn typecheck,oxlintandoxfmt --checkpass.simulator:start --device "iPhone 16 Pro"with this branch against production. The output above is from that run.🤖 Generated with Claude Code