Commit f32aabe
Add comprehensive error handling to image lifecycle
Improvements to create_image:
- Catch and report Docker build failures with clear error messages
- Re-raise exception to fail tests appropriately
Improvements to delete_image:
- Guard against nil @image (if build failed)
- Wrap container cleanup in error handling to continue if issues occur
- Catch individual container cleanup failures and continue
- Handle NotFoundError if image already removed
- Always attempt image removal even if container cleanup fails
- Add informative status messages for debugging
Benefits:
- Tests fail gracefully with clear error messages
- Cleanup attempts even after failures (prevents resource leaks)
- Better visibility into what's happening during cleanup
- Prevents cascading failures from cleanup issues
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>1 parent 096ce0f commit f32aabe
1 file changed
+37
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| |||
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
| 23 | + | |
15 | 24 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
| 43 | + | |
| 44 | + | |
30 | 45 | | |
31 | 46 | | |
32 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
33 | 56 | | |
34 | 57 | | |
35 | 58 | | |
0 commit comments