Skip to content

Replace the ducktape dependency with zero deps - #1

Closed
austince wants to merge 1 commit into
mainfrom
replace-ducttape-no-deps-2
Closed

Replace the ducktape dependency with zero deps#1
austince wants to merge 1 commit into
mainfrom
replace-ducttape-no-deps-2

Conversation

@austince

Copy link
Copy Markdown
Owner

No description provided.

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. No new runtime dependencies are
introduced.
Internal package additions (org.testcontainers.utility):
- RateLimiter (abstract class) + RateLimiterBuilder: sleep-based pacing
with constant-throughput strategy. Method names doWhenReady/getWhenReady
match the historical duct-tape API so existing TC source-compat is
preserved.
- Timeouts.getWithTimeout / doWithTimeout: per-call ExecutorService with
daemon worker thread, shutdownNow() in finally — fixes the duct-tape
zombie-thread bug (testcontainers#9227).
- Unreliables.retryUntilSuccess / retryUntilTrue: retry loop wrapped in
Timeouts.getWithTimeout. Interrupt-induced exceptions are not allowed
to overwrite the genuine last failure so callers diagnose the real
cause (e.g. SSLHandshakeException) instead of the cancellation.
- 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: testcontainers#9241
@austince
austinceforce-pushed the replace-ducttape-no-deps-2 branch from 918c3c9 to bdde324CompareMay 19, 2026 21:44
@austince

Copy link
Copy Markdown
OwnerAuthor

opening upstream

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@austince