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

fix: logcat process is not restarted in some cases #4573

Merged
merged 1 commit into from
May 2, 2019

Conversation

rosen-vladimirov
Copy link
Contributor

In case you have keepSingleProcess passed to logcat Stream (this option is passed when using CLI as a library - in this case we keep a long living logcat process alive and change only the filter for it by specifying different PIDs), in case the logcat process dies (for example device is disconnected), the process is not cleaned from CLI's internal cache.
This way, in case you try to start the logs again (in the example above - just attach the device again), they are not started as CLI thinks it has a process for this case. So, in case the logcat stream process dies, ensure we clean all the resources related to it.
Add unit tests for this case and remove calls to type/cat from the tests - there's no need to spawn actual child process in the tests.

PR Checklist

What is the current behavior?

When using CLI as a library attaching Android device, disconnecting it after that and reconnecting it does not show any logs for this device.

What is the new behavior?

Logs from Android devices are properly shown.

Fixes issue in Sidekick (logged in JIRA)

In case you have `keepSingleProcess` passed to logcat Stream (this option is passed when using CLI as a library - in this case we keep a long living logcat process alive and change only the filter for it by specifying different PIDs), in case the logcat process dies (for example device is disconnected), the process is not cleaned from CLI's internal cache.
This way, in case you try to start the logs again (in the example above - just attach the device again), they are not started as CLI thinks it has a process for this case. So, in case the logcat stream process dies, ensure we clean all the resources related to it.
Add unit tests for this case and remove calls to `type`/`cat` from the tests - there's no need to spawn actual child process in the tests.
@rosen-vladimirov rosen-vladimirov added this to the 5.4.0 milestone Apr 30, 2019
@rosen-vladimirov rosen-vladimirov requested a review from Fatme April 30, 2019 13:07
@rosen-vladimirov rosen-vladimirov self-assigned this Apr 30, 2019
@cla-bot cla-bot bot added the cla: yes label Apr 30, 2019
@ghost ghost added the new PR label Apr 30, 2019
@rosen-vladimirov
Copy link
Contributor Author

test cli-smoke

@rosen-vladimirov rosen-vladimirov merged commit 873d82b into master May 2, 2019
@ghost ghost removed the new PR label May 2, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-android-logs-2 branch May 2, 2019 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants