Giter Club home page Giter Club logo

Comments (10)

jlipps avatar jlipps commented on May 20, 2024

If appium closes instruments successfully, it will delete the .trace directories by default. If instruments crashes, they won't be deleted. Alternatives are:

  • have appium delete extraneous directories on startup too
  • create a "grunt cleanup" command that makes it easy to clean things up

from appium.

bootstraponline avatar bootstraponline commented on May 20, 2024

It'd be nice if they were deleted on startup and when @driver.quit is called.

from appium.

jlipps avatar jlipps commented on May 20, 2024

They are deleted in every case that appium itself doesn't crash due to an error or we can't get the name of the tracedir for some reason. So when you call @driver.quit, appium shuts down instruments and retrieves the name of the tracedir which instruments created (which we can always get except maybe in some rare instruments crash cases). It then (by default) removes this tracedir. So if you run a clean test, you should see no tracedirs in your appium directory afterward. Is this not your experience?

If what you're asking about is "how do we get rid of these even when something goes wrong and we can't know that a tracedir was created", then we'll have to resort to some kind of rm -rf *.trace that just gets called at some point in the flow---and even this won't be guaranteed to run if we crash beforehand.

I'm more inclined to (a) try to figure out why these crashes are happening and exit gracefully instead, perhaps removing tracedirs that we detect in another way and (b) adding a "cleanup" script which gets rid of these along with the instruments socket and any other tempfiles that appium might have created. This could be run with grunt clean or something similar.

from appium.

bootstraponline avatar bootstraponline commented on May 20, 2024

So if you run a clean test, you should see no tracedirs in your appium directory afterward. Is this not your experience?

Appium frequently crashes and I'm left with tons of instrumentscli0.trace folders. I'd rather not have to manually run a cleanup script. Couldn't @driver.quit remove all .trace folders instead of just the most recent one? I don't see why it'd be helpful to retain them.

from appium.

jlipps avatar jlipps commented on May 20, 2024

It could, but for some people those tracedirs contain valuable diagnostic information (or so I have been told). I'm fine blowing them all away if a flag is set, though. Another issue with this particular suggestion is that if Appium itself crashes, we can't do anything at all on @driver.quit, since the server is no longer even listening. We could also do it on server startup, which doesn't guarantee no tracedirs ever, but at least keeps things more clean. Anyway, I'll go ahead and implement something that will delete these dirs more often.

from appium.

bootstraponline avatar bootstraponline commented on May 20, 2024

I guess the real solution is fixing the crash issues then it won't be a problem. A flag would be nice.

execute_script 'mobile: setRemoveAllTraceOnQuit', 1

from appium.

jlipps avatar jlipps commented on May 20, 2024

The flag I'm thinking of already exists, it's --remove and on by default when starting the appium server itself (I think this is something for the server to know about, not the client---the client could be on a completely different machine, after all).

from appium.

bootstraponline avatar bootstraponline commented on May 20, 2024

Sounds good.

from appium.

jlipps avatar jlipps commented on May 20, 2024

let me know if this doesn't delete things often enough for you.

from appium.

lock avatar lock commented on May 20, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from appium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.