Skip to content

Commit

Permalink
Merge branch 'main' into feat/gherkin-rework
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <[email protected]>
  • Loading branch information
aepfli committed Jan 15, 2025
2 parents 2b81d5b + 514004f commit 3ded8cd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
5 changes: 4 additions & 1 deletion providers/flagd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
<version>1.5.4</version>
<version>1.5.5</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -155,12 +155,15 @@
<version>1.20.4</version>
<scope>test</scope>
</dependency>
<!-- uncomment for logoutput during test runs -->
<!--
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.16</version>
<scope>test</scope>
</dependency>
-->
</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public synchronized void initialize(EvaluationContext evaluationContext) throws
this.flagResolver.init();
// block till ready - this works with deadline fine for rpc, but with in_process we also need to take parsing
// into the equation
Util.busyWaitAndCheck(this.deadline + 1000, () -> initialized);
// TODO: evaluate where we are losing time, so we can remove this magic number - follow up
Util.busyWaitAndCheck(this.deadline + 200, () -> initialized);
}

@Override
Expand Down Expand Up @@ -184,6 +185,7 @@ EvaluationContext getEnrichedContext() {
return enrichedContext;
}

@SuppressWarnings("checkstyle:fallthrough")
private void onProviderEvent(FlagdProviderEvent flagdProviderEvent) {

syncMetadata = flagdProviderEvent.getSyncMetadata();
Expand Down Expand Up @@ -211,6 +213,8 @@ private void onProviderEvent(FlagdProviderEvent flagdProviderEvent) {
}
previousEvent = ProviderEvent.PROVIDER_ERROR;
break;
default:
log.info("Unknown event {}", flagdProviderEvent.getEvent());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "dev.openfeature.contrib.providers.flagd.e2e.steps")
@ConfigurationParameter(key = OBJECT_FACTORY_PROPERTY_NAME, value = "io.cucumber.picocontainer.PicoFactory")
@IncludeTags({"rpc"})
@ExcludeTags({"targetURI"})
@ExcludeTags({"targetURI", "unixsocket"})
@Testcontainers
public class RunRpcTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,13 @@ public class ProviderSteps extends AbstractSteps {

public static final int UNAVAILABLE_PORT = 9999;
static Map<ProviderType, FlagdContainer> containers = new HashMap<>();
static Map<ProviderType, Map<Config.Resolver, String>> proxyports = new HashMap<>();
public static Network network = Network.newNetwork();
public static ToxiproxyContainer toxiproxy =
new ToxiproxyContainer("ghcr.io/shopify/toxiproxy:2.5.0").withNetwork(network);
public static ToxiproxyClient toxiproxyClient;

static Path sharedTempDir;

static {
try {
sharedTempDir = Files.createDirectories(
Paths.get("tmp/" + RandomStringUtils.randomAlphanumeric(8).toLowerCase() + "/"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}

private Timer restartTimer;

public ProviderSteps(State state) {
super(state);
}
Expand All @@ -83,6 +71,8 @@ public static void beforeAll() throws IOException {
ProviderType.DEFAULT, new FlagdContainer().withNetwork(network).withNetworkAliases("default"));
containers.put(
ProviderType.SSL, new FlagdContainer("ssl").withNetwork(network).withNetworkAliases("ssl"));
sharedTempDir = Files.createDirectories(
Paths.get("tmp/" + RandomStringUtils.randomAlphanumeric(8).toLowerCase() + "/"));
containers.put(
ProviderType.SOCKET,
new FlagdContainer("socket")
Expand Down Expand Up @@ -209,7 +199,7 @@ public void run() {
}
}
};
restartTimer = new Timer("Timer" + randomizer);
Timer restartTimer = new Timer("Timer" + randomizer);

restartTimer.schedule(task, seconds * 1000L);
}
Expand Down
2 changes: 0 additions & 2 deletions providers/flagd/src/test/resources/simplelogger.properties

This file was deleted.

0 comments on commit 3ded8cd

Please sign in to comment.