Improve reliability of StopAvd with try-catch logic
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- android, csharp
- Domain
- mobile-dev, tooling
Research direction
Start in AndroidSdk/Emulator/Emulator.cs and inspect the StopAvd polling loop, especially its calls to adb.GetDevices(). Review how SdkToolFailedExitException is handled elsewhere, then verify that shutdown failures do not escape the method and that StopAvd still returns a boolean by the timeout.
Written by the indexing model from the issue text.
Description
The 'StopAvd' method in 'AndroidSdk/Emulator/Emulator.cs' polls 'adb.GetDevices()' during shutdown, but 'GetDevices()' can throw 'SdkToolFailedExitException' if adb exits with a non-zero status.
As identified in PR #63 review (https://github.com/Redth/AndroidSdk.Tools/pull/63#discussion_r2818506593), this can cause 'StopAvd' to throw an exception instead of returning a boolean as expected.
To improve reliability, especially in CI environments where adb might be flaky during shutdown sequences, this method should:
- Wrap the polling loop in a try-catch block.
- Catch 'SdkToolFailedExitException' (and possibly others).
- Treat failures as 'still running' (or retry) until the timeout is reached.
This ensures the method adheres to its contract of returning true/false rather than crashing.
- Dominant language
- C#
- Stars
- 78
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Redth/AndroidSdk.Tools
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
Redth/AndroidSdk.Tools#85 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
Redth/AndroidSdk.Tools#84 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Redth/AndroidSdk.Tools#66 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Redth/AndroidSdk.Tools#65 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Redth/AndroidSdk.Tools#41 ·
All issues in Redth/AndroidSdk.Tools
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·