diff --git a/model/src/main/java/com/salesforce/apollo/model/ProcessDomain.java b/model/src/main/java/com/salesforce/apollo/model/ProcessDomain.java index 3dee46cf6..2916c89b6 100644 --- a/model/src/main/java/com/salesforce/apollo/model/ProcessDomain.java +++ b/model/src/main/java/com/salesforce/apollo/model/ProcessDomain.java @@ -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(), diff --git a/model/src/test/java/com/salesforce/apollo/model/ContainmentDomainTest.java b/model/src/test/java/com/salesforce/apollo/model/ContainmentDomainTest.java index 5dd74b968..a33746955 100644 --- a/model/src/test/java/com/salesforce/apollo/model/ContainmentDomainTest.java +++ b/model/src/test/java/com/salesforce/apollo/model/ContainmentDomainTest.java @@ -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( @@ -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()) diff --git a/model/src/test/java/com/salesforce/apollo/model/DomainTest.java b/model/src/test/java/com/salesforce/apollo/model/DomainTest.java index 34b14fbdc..25a714c97 100644 --- a/model/src/test/java/com/salesforce/apollo/model/DomainTest.java +++ b/model/src/test/java/com/salesforce/apollo/model/DomainTest.java @@ -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) diff --git a/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java b/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java index caa51b54c..597d99113 100644 --- a/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java +++ b/model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java @@ -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) @@ -139,12 +140,13 @@ public void viewChange(Context context, Digest viewId, List { - 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");