Skip to content

Commit

Permalink
again?
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Dec 26, 2023
1 parent f090591 commit 21a392a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ProcessDomain(Digest group, ControlledIdentifierMember member, ProcessDom
.setpByz(parameters.dhtPbyz)
.setId(group)
.build();
final var dhtUrl = String.format("jdbc:h2:mem:%s-%s;DB_CLOSE_DELAY=-1", member.getId(), "");
final var dhtUrl = String.format("jdbc:h2:mem:%s-%s;DB_CLOSE_DELAY=-1", member.getId(), UUID.randomUUID());
JdbcConnectionPool connectionPool = JdbcConnectionPool.create(dhtUrl, "", "");
connectionPool.setMaxConnections(10);
dht = new KerlDHT(parameters.dhtOpsFrequency, base, member, connectionPool, params.digestAlgorithm(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ public void before() throws Exception {
final var member = new ControlledIdentifierMember(id);
var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30));
routers.add(localRouter);
var pdParams = new ProcessDomain.ProcessDomainParameters("jdbc:h2:mem:", Duration.ofMinutes(1),
checkpointDirBase, Duration.ofMillis(10), 0.00125,
var dbUrl = String.format("jdbc:h2:mem:%s-%s;DB_CLOSE_DELAY=-1", member.getId(), UUID.randomUUID());
var pdParams = new ProcessDomain.ProcessDomainParameters(dbUrl, Duration.ofMinutes(1), checkpointDirBase,
Duration.ofMillis(10), 0.00125,
Duration.ofMinutes(1), 3, 10, 0.1);
var domain = new ProcessContainerDomain(group, member, pdParams, params, RuntimeParameters.newBuilder()
.setFoundation(
Expand All @@ -106,7 +107,7 @@ public void before() throws Exception {

@Test
public void smoke() throws Exception {
domains.forEach(Domain::start);
domains.forEach(e -> Thread.ofVirtual().start(e::start));
final var activated = Utils.waitForCondition(60_000, 1_000, () -> domains.stream().allMatch(Domain::active));
assertTrue(activated, "Domains did not fully activate: " + (domains.stream()
.filter(c -> !c.active())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ public void before() throws Exception {
final var member = new ControlledIdentifierMember(id);
var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30));
routers.add(localRouter);
var pdParams = new ProcessDomain.ProcessDomainParameters("jdbc:h2:mem:", Duration.ofMinutes(1),
checkpointDirBase, Duration.ofMillis(10), 0.00125,
var dbUrl = String.format("jdbc:h2:mem:%s-%s;DB_CLOSE_DELAY=-1", member.getId(), UUID.randomUUID());
var pdParams = new ProcessDomain.ProcessDomainParameters(dbUrl, Duration.ofMinutes(1), checkpointDirBase,
Duration.ofMillis(10), 0.00125,
Duration.ofMinutes(1), 3, 10, 0.1);
var domain = new ProcessDomain(group, member, pdParams, params, RuntimeParameters.newBuilder()
.setFoundation(sealed)
Expand Down
18 changes: 10 additions & 8 deletions model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ public void before() throws Exception {
var context = new ContextImpl<>(DigestAlgorithm.DEFAULT.getLast(), CARDINALITY, 0.2, 3);
final var member = new ControlledIdentifierMember(id);
var localRouter = new LocalServer(prefix, member).router(ServerConnectionCache.newBuilder().setTarget(30));
var pdParams = new ProcessDomain.ProcessDomainParameters("jdbc:h2:mem:", Duration.ofSeconds(5),
checkpointDirBase, Duration.ofMillis(10), 0.00125,
var dbUrl = String.format("jdbc:h2:mem:%s-%s;DB_CLOSE_DELAY=-1", member.getId(), UUID.randomUUID());
var pdParams = new ProcessDomain.ProcessDomainParameters(dbUrl, Duration.ofSeconds(5), checkpointDirBase,
Duration.ofMillis(10), 0.00125,
Duration.ofSeconds(5), 3, 10, 0.1);
var node = new ProcessDomain(group, member, pdParams, params, RuntimeParameters.newBuilder()
.setFoundation(sealed)
Expand Down Expand Up @@ -139,12 +140,13 @@ public void viewChange(Context<Participant> context, Digest viewId, List<EventCo
assertTrue(started.get().await(10, TimeUnit.SECONDS), "Cannot start up kernel");

started.set(new CountDownLatch(CARDINALITY - 1));
domains.subList(1, domains.size()).parallelStream().forEach(d -> {
d.getFoundation()
.start(() -> started.get().countDown(), gossipDuration, seeds,
Executors.newScheduledThreadPool(1, Thread.ofVirtual().factory()));
});
assertTrue(started.get().await(10, TimeUnit.SECONDS), "could not start views");
domains.subList(1, domains.size())
.forEach(d -> Thread.ofVirtual()
.start(() -> d.getFoundation()
.start(() -> started.get().countDown(), gossipDuration, seeds,
Executors.newScheduledThreadPool(1, Thread.ofVirtual()
.factory()))));
assertTrue(started.get().await(30, TimeUnit.SECONDS), "could not start views");

assertTrue(countdown.await(30, TimeUnit.SECONDS), "Could not join all members in all views");

Expand Down

0 comments on commit 21a392a

Please sign in to comment.