Commit 89e8bff
committed
Replace duct-tape with resilience4j-backed internal utilities
Removes the dependency on org.rnorth.duct-tape:duct-tape:1.0.8 by
re-implementing the small subset of duct-tape used by Testcontainers
inside org.testcontainers.utility, backed by resilience4j modules per
maintainer preference in #9241.
New runtime dependencies (shaded):
- io.github.resilience4j:resilience4j-timelimiter:1.7.1
- io.github.resilience4j:resilience4j-ratelimiter:1.7.1
Internal package additions (org.testcontainers.utility):
- RateLimiter (interface) + RateLimiterBuilder: thin facade with the
historical duct-tape method names doWhenReady / getWhenReady, backed
by a resilience4j RateLimiter adapter. The shaded resilience4j type
never leaks into the public API.
- Timeouts.getWithTimeout / doWithTimeout: per-call ExecutorService
with daemon worker thread, shutdownNow() in finally and resilience4j
TimeLimiter (cancelRunningFuture=true) — fixes the duct-tape
zombie-thread bug (#9227).
- Unreliables.retryUntilSuccess / retryUntilTrue: retry loop wrapped
in Timeouts.getWithTimeout. Interrupt-induced exceptions
(resilience4j's AcquirePermissionCancelledException, etc.) are not
allowed to overwrite the genuine last failure so callers diagnose
the real cause (e.g. SSLHandshakeException).
- TimeoutException, RetryCountExceededException: unchecked, matching
duct-tape's semantics so existing callers compile unchanged. Message
"Retry limit hit with exception" is preserved verbatim for
GenericContainerTest's existing assertion.
Public API impact:
- AbstractWaitStrategy.getRateLimiter() and withRateLimiter() now take
org.testcontainers.utility.RateLimiter instead of
org.rnorth.ducttape.ratelimits.RateLimiter. Source-compat is preserved
for callers that go through AbstractWaitStrategy; only callers that
explicitly imported the duct-tape types break.
- Both methods are added to japicmp's methodExcludes with a comment
explaining the binary-breaking change.
Callers updated to use the new types: GenericContainer,
HttpWaitStrategy, ShellStrategy, DockerHealthcheckWaitStrategy,
WaitAllStrategy, StartupCheckStrategy, DockerClientProviderStrategy,
RyukResourceReaper, CassandraQueryWaitStrategy (both packages),
YugabyteDBY{CQL,SQL}WaitStrategy, and the corresponding tests.
Refs: #92411 parent 3878311 commit 89e8bff
39 files changed
Lines changed: 381 additions & 61 deletions
File tree
- annotations/org/rnorth/ducttape
- config/checkstyle
- core
- src
- main/java/org/testcontainers
- containers
- startupcheck
- wait/strategy
- dockerclient
- utility
- test/java/org/testcontainers
- containers
- wait
- internal
- strategy
- images/builder/dockerfile/statement
- junit
- wait/strategy
- modules
- cassandra/src/main/java/org/testcontainers
- cassandra
- containers/wait
- couchbase/src/main/java/org/testcontainers/couchbase
- localstack/src/main/java/org/testcontainers/containers/localstack
- selenium/src/main/java/org/testcontainers/containers
- yugabytedb/src/main/java/org/testcontainers/containers/strategy
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
| |||
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments