-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove withPublishAllPorts from Ryuk and stabilize containerInfo content on start #4263
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1cea186
Inspect container until mapped ports are present.
kiview 114077a
Remove withPublishAllPorts from Ryuk container.
kiview 0f12e23
Use ContainerLaunchException
kiview 80b511c
Fix ReusabilityUnitTests
kiview 5dacc40
Remove unnecessary branching as per review when checking mapped ports.
kiview 982f1f8
Add sleeps while waiting for mapped ports in inspect command.
kiview 8bbd654
Use deep stub in ReusabilityUnitTests for InspectContainerResponse.
kiview ac9b00a
Merge branch 'master' into windows-stability
895b7f5
Use awaitility when waiting for inspect to contain mapped ports
54987b2
Update core/src/main/java/org/testcontainers/utility/ResourceReaper.java
kiview a977f0b
Address PR comments on ResourceReaper
b390143
Use DynamicPollInterval
13722d8
Address PR review
ab6cf5e
Use 50ms poll interval
3a01b32
Wait until at least all ports known to TC as exposed
1a7f5de
Add test for multiple exposed ports that are unknown to TC
00aa6a2
Fix typo
1a32ab2
Wait for mapped ports to be present
3504d71
Code style
451bbcb
Update core/src/test/java/org/testcontainers/containers/GenericContai…
kiview File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
core/src/main/java/org/testcontainers/utility/DynamicPollInterval.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.testcontainers.utility; | ||
|
||
import org.awaitility.pollinterval.PollInterval; | ||
|
||
import java.time.Duration; | ||
import java.time.Instant; | ||
|
||
/** | ||
* Awaitility {@link org.awaitility.pollinterval.PollInterval} that takes execution time into consideration, | ||
* to allow a constant poll-interval, as opposed to Awaitility's default poll-delay behaviour. | ||
* | ||
* @deprecated For internal usage only. | ||
*/ | ||
@Deprecated | ||
public class DynamicPollInterval implements PollInterval { | ||
|
||
final Duration interval; | ||
Instant lastTimestamp; | ||
|
||
private DynamicPollInterval(Duration interval) { | ||
this.interval = interval; | ||
lastTimestamp = Instant.now(); | ||
} | ||
|
||
public static DynamicPollInterval of(Duration duration) { | ||
return new DynamicPollInterval(duration); | ||
} | ||
|
||
public static DynamicPollInterval ofMillis(long millis) { | ||
return DynamicPollInterval.of(Duration.ofMillis(millis)); | ||
} | ||
|
||
@Override | ||
public Duration next(int pollCount, Duration previousDuration) { | ||
Instant now = Instant.now(); | ||
Duration executionDuration = Duration.between(lastTimestamp, now); | ||
|
||
Duration result = interval.minusMillis(Math.min(interval.toMillis(), executionDuration.toMillis())); | ||
lastTimestamp = now.plus(result); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, sorry for the autoformat here.