-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: blocking in-process init, e2e tests (#436)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
- Loading branch information
Showing
19 changed files
with
343 additions
and
220 deletions.
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
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
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
27 changes: 27 additions & 0 deletions
27
...ers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/Util.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,27 @@ | ||
package dev.openfeature.contrib.providers.flagd.resolver.common; | ||
|
||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
/** | ||
* Utils for flagd resolvers. | ||
*/ | ||
public class Util { | ||
/** | ||
* A helper to block the caller for given conditions. | ||
* | ||
* @param deadline number of milliseconds to block | ||
* @param check {@link AtomicBoolean} to check for status true | ||
*/ | ||
public static void busyWaitAndCheck(final Long deadline, final AtomicBoolean check) throws InterruptedException { | ||
long start = System.currentTimeMillis(); | ||
|
||
do { | ||
if (deadline <= System.currentTimeMillis() - start) { | ||
throw new RuntimeException( | ||
String.format("Deadline exceeded. Condition did not complete within the %d deadline", deadline)); | ||
} | ||
|
||
Thread.sleep(50L); | ||
} while (!check.get()); | ||
} | ||
} |
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
Oops, something went wrong.