Skip to content

Conversation

mui-z
Copy link
Owner

@mui-z mui-z commented Aug 31, 2025

  • refactor(concurrency): adopt async/await for simctl execution with concurrent stdout/stderr draining and timeout race
  • fix(concurrency): resolve Swift 6 compile errors by removing async-let capture in race and marking SimulatorService Sendable

@mui-z mui-z self-assigned this Aug 31, 2025
@mui-z mui-z added the enhancement New feature or request label Aug 31, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@mui-z mui-z force-pushed the chore/replace-swift-concurrency branch from e7a34b0 to 21fc5c2 Compare September 2, 2025 23:24
@mui-z
Copy link
Owner Author

mui-z commented Sep 2, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +94 to +98
// Race process exit vs timeout sleep
let first = await withTaskGroup(of: Int.self) { group -> Int in
group.addTask { await waitForExitAsync(process); return 0 }
group.addTask { try? await Task.sleep(nanoseconds: timeoutNanos); return 1 }
return await group.next() ?? 0

Choose a reason for hiding this comment

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

[P1] Reinstate non-blocking timeout race for simctl process

The new timeout logic uses withTaskGroup to race waitForExitAsync against Task.sleep, but the call returns only after all child tasks complete. Because waitForExitAsync never observes cancellation, the group will wait for the simulator process to exit even when the sleep finishes first, so the timeout path cannot fire until the command ends naturally. As a result, hung simctl invocations still block indefinitely and the termination/kill logic is never reached in time.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@codex fix comments

Choose a reason for hiding this comment

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

Summary

Testing

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant