Commit 52b6949
authored
Make sure we don't hide exceptions from waitUntilContainerStarted (#6167)
This adds the original exception as the cause. It also adds the
text "Wait strategy failed." to each exception message.
This addresses two issues:
1. The original exception from waitUntilContainerStarted was not
being included as the cause in newly thrown exceptions in
tryStart. The exceptions were not completely hidden because
they were being logged, however, but the initial cause was
less visible.
2. The exception messages focused on state that was found at the
time the exception was received but did not mention that the
waitUntilContainerStarted method threw an exception.
Because of these issues, unless you look at the source or see the
logs, it isn't clear that this was caused by an exception from
waitUntilContainerStarted. In systems that might highlight the
failure message and stack trace and not logs/console output (test
failure reports, CI systems, etc.), it makes it harder to debug
these issues.
Updated tests to check for the updated messages as well as the
exception from waitUntilContainerStarted.1 parent 3b24a7d commit 52b6949
File tree
2 files changed
+26
-10
lines changed- core/src
- main/java/org/testcontainers/containers
- test/java/org/testcontainers/containers
2 files changed
+26
-10
lines changedLines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
506 | 509 | | |
507 | 510 | | |
508 | 511 | | |
509 | 512 | | |
510 | | - | |
| 513 | + | |
511 | 514 | | |
512 | 515 | | |
513 | 516 | | |
514 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
515 | 521 | | |
516 | 522 | | |
517 | 523 | | |
| |||
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
83 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
| |||
0 commit comments