Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper shutdown mechanism #559

Merged
merged 2 commits into from
Aug 29, 2023
Merged

Proper shutdown mechanism #559

merged 2 commits into from
Aug 29, 2023

Conversation

nanwng
Copy link
Collaborator

@nanwng nanwng commented Aug 29, 2023

We were seeing lots of test timeout issues on macOS Ventura machines. It turned out that there's some shutdown error for simulators causing hanging bp processes. See below log for example:

{24164} 20230825.132813 [  ERROR ] (BP-1) Timeout: [Attempt 1] Create Simulator
{24164} 20230825.132813 [  ERROR ] (BP-1) The operation couldn’t be completed. (org.linkedin.bluepill.ErrorDomain error -1.)
{24164} 20230825.132813 [  INFO  ] (BP-1) Relaunching the simulator due to a BAD STATE
{24164} 20230825.132813 [  INFO  ] (BP-1) [Attempt 1] Delete Simulator
{24164} 20230825.132813 [  INFO  ] (BP-1) Shutting down Simulator
{24164} 20230825.132859 [  INFO  ] (BP-1) Simulator 0F53DAFD-72C0-4B9C-8DA0-6975202DBB28 achieved the BOOTED state Booted
{24164} 20230825.132900 [  INFO  ] (BP-1) Completed: [Attempt 1] Delete Simulator 0F53DAFD-72C0-4B9C-8DA0-6975202DBB28
{24164} 20230825.132900 [  ERROR ] (BP-1) EndTimerFailure: EndTimer called without starting a timer for 'Simulator 0F53DAFD-72C0-4B9C-8DA0-6975202DBB28'
{24164} 20230825.132900 [  INFO  ] (BP-1) [Attempt 1] Create Simulator
{24164} 20230825.132900 [  INFO  ] (BP-1) Booting a simulator without launching Simulator app
{24164} 20230825.133118 [  ERROR ] (BP-1) Simulator 354C7BB2-724C-4BEE-A966-29CF01B867B9 failed to boot. State: Shutdown
{24164} 20230825.133118 [  ERROR ] (BP-1) Shutting down Simulator failed: Unable to shutdown device in current state: Shutdown
{24164} 20230825.133118 [  ERROR ] (BP-1) Completed: [Attempt 1] Create Simulator 354C7BB2-724C-4BEE-A966-29CF01B867B9
{24164} 20230825.133118 [  ERROR ] (BP-1) Unable to boot the Simulator.
{24164} 20230825.133118 [  INFO  ] (BP-1) [Attempt 1] Delete Simulator
{24164} 20230825.133118 [  INFO  ] (BP-1) Shutting down Simulator
{24164} 20230825.133118 [  ERROR ] (BP-1) Shutting down Simulator failed: Unable to shutdown device in current state: Shutdown
{24164} 20230825.133118 [  ERROR ] (BP-1) Completed: [Attempt 1] Delete Simulator 354C7BB2-724C-4BEE-A966-29CF01B867B9
{24164} 20230825.133118 [  ERROR ] (BP-1) Unable to shutdown device in current state: Shutdown
{24164} 20230825.133118 [  INFO  ] (BP-1) Attempt's Exit Status: BPExitStatusSimulatorCreationFailed, Bundle exit status: BPExitStatusSimulatorCreationFailed
{24164} 20230825.133118 [  INFO  ] (BP-1) Exit Status: BPExitStatusSimulatorCreationFailed
{24164} 20230825.133118 [  INFO  ] (BP-1) Failure Tolerance: 1
{24164} 20230825.133118 [  INFO  ] (BP-1) Retry count: 1
{24164} 20230825.133118 [  INFO  ] (BP-1) Recovering from tooling problem

Fixing this by not calling the private shutdown api when the simulator is already in the shutdown state.

@nanwng nanwng requested a review from a team as a code owner August 29, 2023 16:33
Signed-off-by: Nan Wang <nanwang1101@yahoo.com>
Signed-off-by: Nan Wang <nanwang1101@yahoo.com>
@chenxiao0228 chenxiao0228 merged commit 668df0b into master Aug 29, 2023
1 of 3 checks passed
@chenxiao0228 chenxiao0228 deleted the nanwng/timeout branch August 29, 2023 16:50
nanwng added a commit that referenced this pull request Aug 29, 2023
* safely shutdown

Signed-off-by: Nan Wang <nanwang1101@yahoo.com>

* no need to erase sims

Signed-off-by: Nan Wang <nanwang1101@yahoo.com>

---------

Signed-off-by: Nan Wang <nanwang1101@yahoo.com>
nanwng added a commit that referenced this pull request Aug 29, 2023
* safely shutdown



* no need to erase sims



---------

Signed-off-by: Nan Wang <nanwang1101@yahoo.com>
nanwng added a commit that referenced this pull request Aug 30, 2023
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.

None yet

2 participants