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

[Appium-Android] Teardown taking longer time due to getting huge "bugreport" log #178

Closed
FachrulCH opened this issue Aug 11, 2020 · 2 comments

Comments

@FachrulCH
Copy link
Contributor

The Problem

Given my test is failing, then my test runner session is freeze some minutes before execution aborted, I'm debugging the codes find out that as part of teardown process toolium will automatically getting log (event not seeing config setting, since toolium.driver_wrappers_pool.DriverWrappersPool.save_all_webdriver_logs condition if driver_wrapper.config.getboolean_optional('Server', 'logs_enabled') or not test_passed: always return True for failing test)

It impacted in getting big data of bugreport, here are the process in my appium server:

[HTTP] --> POST /wd/hub/session/0d78ddf2-16a3-4796-a42a-1265b9bf4a47/log [HTTP] {"type":"bugreport"} [debug] [W3C (0d78ddf2)] Calling AppiumDriver.getLog() with args: ["bugreport","0d78ddf2-16a3-4796-a42a-1265b9bf4a47"] [debug] [BaseDriver] Retrieving 'bugreport' logs [debug] [BaseDriver] Retrieving supported log types [debug] [ADB] Running '/Users/fachrulch/Library/Android/sdk/platform-tools/adb -P 5037 -s 520021f0fec984c1 bugreport' [debug] [W3C (0d78ddf2)] Responding to client with driver.getLog() result: [{"timestamp":1597125881669,"level":"ALL","message":"/data/user_de/0/com.android.shell/files/bugreports/bugreport-2020-08-11-13-03-00.zip: 1 file pulled. 31.1 MB/s (7403500 bytes in 0.227s)"}] [HTTP] <-- POST /wd/hub/session/0d78ddf2-16a3-4796-a42a-1265b9bf4a47/log 200 103499 ms - 202 [HTTP]

What I did

  • I attempted to run command adb logcat -c before test run to make all log clear and getting the log will much become faster, but apparently this command not clearing bugreport, getting bugreport is still huge (31 MB in my
  • I've googled to find how to clean bugreport data before test run, but not found any clue other thatn adb logcat -c (which not works)

Possible solution

I'm thinking it will be good if:

  • toolium can takes only desired log_types in .cfg files (dont call directly selenium.webdriver.remote.webdriver.WebDriver.log_types in toolium.utils.Utils.save_webdriver_logs)

Thank you

@rgonalo
Copy link
Member

rgonalo commented Aug 28, 2020

Thanks for reviewing it, I guess that your proposal sounds good, so I will implemented and notify you.

@rgonalo
Copy link
Member

rgonalo commented Sep 1, 2020

1.7.2 version is already published with this feature. Now log types can be defined in .cfg file:

[Server]
logs_types: client,server

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

No branches or pull requests

2 participants