Comments (5)
My opinion: #36 (comment)
What do others thing?
from autotest-docker.
I'm somewhat against it for the simple reason that it can make debugging dockertest
harder. In other words, allowing cleanup()
exceptions through makes it easier to tell the difference between a docker
problem and a dockertest
problem. OTOH, I'm not against catching/hiding specific exceptions in cleanup()
(or elsewhere) as long as there's a clear reason for it.
@ldoktor @jzupka @Lorquas what do you guys think on this one?
from autotest-docker.
Well, my idea is clearly stated there. I'd like the cleanup to be very tolerant. You won't miss any exceptions as you have all of them listed in the log and the cleanup raises Exception.
About the dependent parts, it's harder to write these kind of cleanups, but you can use blocks of cleanup code (eg. call cleanup_container() for each container, which removes container and it's image. When remove container fails, you won't execute the remove image part, just log the failure and proceed with another container).
So my idea of cleanup is put short cleanups directly into cleanup()
put longer modules into separate cleanup_xxx()
functions.
Anyway after the test everything should be clean, with no hanging containers, nor images or other resources... (eg. failed os.unlink() shouldn't interrupt container cleanup).
Btw I'd also like to create framework function for container cleanup, which should include workarounds like umount /dev/mapper/docker-*
in case docker rm
failure. But it's just for the future...
from autotest-docker.
oh sure, yeah I understand your reasoning. I guess my position is more inclusive, where cleanup()
is also a part of what we're testing (instead of purely a mechanical/plumbing thing).
See also: #55
Another option is to do both, consider cleanup()
as I describe above, then also have between-test guaranteed cleanup that always runs (i.e. after envcheck scripts). If we keep the later part somewhat generalized, it can be re-used for the "best effort" cleanup()
part too.
A third option is we simply forget about cleanup()
in tests entirely, then only rely on automatic, guaranteed cleanup enforced lower-down the stack (maybe similar to envcheck). This would have the benefit of making nearly every test one-method simpler. The down-side is if/when the enforced cleanup breaks, potentially everything breaks.
from autotest-docker.
You won't miss the cleanup failures in the 1st scenario. All failures will still be logged, you'll just proceed the additional cleanup steps.
from autotest-docker.
Related Issues (20)
- info test fails
- commit subtest check_commit_default fail HOT 5
- New test: Pull latest also pulls cooresponding tagged image HOT 1
- cp test fails
- Docs: Add sub-section about subtest documentation
- docker_cli/logs/basic test fails w/ unhelpful exception message
- docker_cli/dockerimport/truncated is unreliable
- New test: iptables / firewalld is working. (Docker 1.7.0) HOT 1
- docker_cli/run_volumes cleanup() in base class is not general purpose
- Pre-check wether image exists before container uses it HOT 2
- Improve conf.py's compability for Sphinx v1.3.1 HOT 2
- new test: Exercise --icc=false w/ docker rm --link HOT 1
- Docs: Update development-env. requirements
- Quick Fix: Make image name parsing regex pretty
- Quick Fix: Default omit_empty=True in get_as_list() HOT 1
- Reimplement some dockertest/docker_daemon.py functions HOT 3
- redhat/packaging test fails on Atomic Host HOT 8
- run_cgroups/memory_no_cgroup : fix handling of 0
- Dockercmd module documentation
- Add support for Ubuntu HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autotest-docker.