Skip to content

Commit

Permalink
fix test params
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Apr 28, 2024
1 parent 2d21795 commit 5fda6e5
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public void viewConsensus() {
public Transitions viewAcquired() {
return GATHER;
}

@Override
public Transitions proposed() {
return null;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
import com.salesforce.apollo.archipelago.ServerConnectionCache;
import com.salesforce.apollo.choam.Parameters;
import com.salesforce.apollo.choam.Parameters.Builder;
import com.salesforce.apollo.choam.Parameters.ProducerParameters;
import com.salesforce.apollo.choam.Parameters.RuntimeParameters;
import com.salesforce.apollo.choam.proto.FoundationSeal;
import com.salesforce.apollo.choam.support.ExponentialBackoffPolicy;
import com.salesforce.apollo.context.DynamicContextImpl;
import com.salesforce.apollo.cryptography.Digest;
import com.salesforce.apollo.cryptography.DigestAlgorithm;
import com.salesforce.apollo.delphinius.Oracle;
import com.salesforce.apollo.ethereal.Config;
import com.salesforce.apollo.membership.stereotomy.ControlledIdentifierMember;
import com.salesforce.apollo.stereotomy.StereotomyImpl;
import com.salesforce.apollo.stereotomy.identifier.spec.IdentifierSpecification;
Expand Down Expand Up @@ -90,13 +91,11 @@ public void before() throws Exception {
"jdbc:h2:mem:%s-state".formatted(d),
checkpointDirBase, Duration.ofMillis(10), 0.00125,
Duration.ofMinutes(1), 3, 10, 0.1);
var domain = new ProcessContainerDomain(group, member, pdParams, params, RuntimeParameters.newBuilder()
.setFoundation(
sealed)
.setContext(
context)
.setCommunications(
localRouter),
var domain = new ProcessContainerDomain(group, member, pdParams, params.clone(),
RuntimeParameters.newBuilder()
.setFoundation(sealed)
.setContext(context)
.setCommunications(localRouter),
new InetSocketAddress(0), commsDirectory, ffParams,
IdentifierSpecification.newBuilder(), null);
domains.add(domain);
Expand All @@ -120,18 +119,27 @@ public void smoke() throws Exception {
}

private Builder params() {
var params = Parameters.newBuilder()
.setGenerateGenesis(true)
.setGenesisViewId(GENESIS_VIEW_ID)
.setGossipDuration(Duration.ofMillis(10))
.setProducer(ProducerParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(20))
.setBatchInterval(Duration.ofMillis(100))
.setMaxBatchByteSize(1024 * 1024)
.setMaxBatchCount(3000)
.build())
.setCheckpointBlockDelta(200);
params.getProducer().ethereal().setEpochLength(4).setNumberOfEpochs(4);
return params;
var template = Parameters.newBuilder()
.setGenerateGenesis(true)
.setGenesisViewId(GENESIS_VIEW_ID)
.setBootstrap(Parameters.BootstrapParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.build())
.setGenesisViewId(DigestAlgorithm.DEFAULT.getOrigin())
.setGossipDuration(Duration.ofMillis(50))
.setProducer(Parameters.ProducerParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.setBatchInterval(Duration.ofMillis(50))
.setMaxBatchByteSize(1024 * 1024)
.setMaxBatchCount(10_000)
.setEthereal(Config.newBuilder()
.setNumberOfEpochs(3)
.setEpochLength(7))
.build())
.setCheckpointBlockDelta(200)
.setDrainPolicy(ExponentialBackoffPolicy.newBuilder()
.setInitialBackoff(Duration.ofMillis(1))
.setMaxBackoff(Duration.ofMillis(1)));
return template;
}
}
50 changes: 31 additions & 19 deletions model/src/test/java/com/salesforce/apollo/model/DomainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
import com.salesforce.apollo.archipelago.ServerConnectionCache;
import com.salesforce.apollo.choam.Parameters;
import com.salesforce.apollo.choam.Parameters.Builder;
import com.salesforce.apollo.choam.Parameters.ProducerParameters;
import com.salesforce.apollo.choam.Parameters.RuntimeParameters;
import com.salesforce.apollo.choam.proto.FoundationSeal;
import com.salesforce.apollo.choam.support.ExponentialBackoffPolicy;
import com.salesforce.apollo.context.DynamicContextImpl;
import com.salesforce.apollo.cryptography.Digest;
import com.salesforce.apollo.cryptography.DigestAlgorithm;
import com.salesforce.apollo.delphinius.Oracle;
import com.salesforce.apollo.delphinius.Oracle.Assertion;
import com.salesforce.apollo.ethereal.Config;
import com.salesforce.apollo.membership.stereotomy.ControlledIdentifierMember;
import com.salesforce.apollo.stereotomy.StereotomyImpl;
import com.salesforce.apollo.stereotomy.mem.MemKERL;
Expand Down Expand Up @@ -220,11 +221,13 @@ public void before() throws Exception {
"jdbc:h2:mem:%s-state;DB_CLOSE_DELAY=-1".formatted(
d), 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)
.setContext(context)
.setCommunications(
localRouter),
var domain = new ProcessDomain(group, member, pdParams, params.clone(), RuntimeParameters.newBuilder()
.setFoundation(
sealed)
.setContext(
context)
.setCommunications(
localRouter),
new InetSocketAddress(0), ffParams, null);
domains.add(domain);
localRouter.start();
Expand All @@ -247,18 +250,27 @@ public void smoke() throws Exception {
}

private Builder params() {
var params = Parameters.newBuilder()
.setGenerateGenesis(true)
.setGenesisViewId(GENESIS_VIEW_ID)
.setGossipDuration(Duration.ofMillis(10))
.setProducer(ProducerParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(20))
.setBatchInterval(Duration.ofMillis(100))
.setMaxBatchByteSize(1024 * 1024)
.setMaxBatchCount(3000)
.build())
.setCheckpointBlockDelta(200);
params.getProducer().ethereal().setEpochLength(7).setNumberOfEpochs(3);
return params;
var template = Parameters.newBuilder()
.setGenerateGenesis(true)
.setGenesisViewId(GENESIS_VIEW_ID)
.setBootstrap(Parameters.BootstrapParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.build())
.setGenesisViewId(DigestAlgorithm.DEFAULT.getOrigin())
.setGossipDuration(Duration.ofMillis(50))
.setProducer(Parameters.ProducerParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.setBatchInterval(Duration.ofMillis(50))
.setMaxBatchByteSize(1024 * 1024)
.setMaxBatchCount(10_000)
.setEthereal(Config.newBuilder()
.setNumberOfEpochs(3)
.setEpochLength(7))
.build())
.setCheckpointBlockDelta(200)
.setDrainPolicy(ExponentialBackoffPolicy.newBuilder()
.setInitialBackoff(Duration.ofMillis(1))
.setMaxBackoff(Duration.ofMillis(1)));
return template;
}
}
50 changes: 30 additions & 20 deletions model/src/test/java/com/salesforce/apollo/model/FireFliesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
import com.salesforce.apollo.archipelago.ServerConnectionCache;
import com.salesforce.apollo.choam.Parameters;
import com.salesforce.apollo.choam.Parameters.Builder;
import com.salesforce.apollo.choam.Parameters.ProducerParameters;
import com.salesforce.apollo.choam.Parameters.RuntimeParameters;
import com.salesforce.apollo.choam.proto.FoundationSeal;
import com.salesforce.apollo.choam.support.ExponentialBackoffPolicy;
import com.salesforce.apollo.context.Context;
import com.salesforce.apollo.context.DynamicContextImpl;
import com.salesforce.apollo.cryptography.Digest;
import com.salesforce.apollo.cryptography.DigestAlgorithm;
import com.salesforce.apollo.delphinius.Oracle;
import com.salesforce.apollo.ethereal.Config;
import com.salesforce.apollo.fireflies.View.Seed;
import com.salesforce.apollo.membership.stereotomy.ControlledIdentifierMember;
import com.salesforce.apollo.stereotomy.StereotomyImpl;
Expand Down Expand Up @@ -89,11 +90,12 @@ public void before() throws Exception {
"jdbc:h2:mem:%s-state".formatted(digest),
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)
.setContext(context)
.setCommunications(
localRouter),
var node = new ProcessDomain(group, member, pdParams, params.clone(), RuntimeParameters.newBuilder()
.setFoundation(
sealed)
.setContext(context)
.setCommunications(
localRouter),
new InetSocketAddress(0), ffParams, null);
domains.add(node);
routers.put(node, localRouter);
Expand Down Expand Up @@ -169,19 +171,27 @@ public void smokin() throws Exception {
}

private Builder params() {
var params = Parameters.newBuilder()
.setGenerateGenesis(true)
.setGenesisViewId(GENESIS_VIEW_ID)
.setGossipDuration(Duration.ofMillis(50))
.setProducer(ProducerParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.setBatchInterval(Duration.ofMillis(100))
.setMaxBatchByteSize(1024 * 1024)
.setMaxBatchCount(3000)
.build())
.setCheckpointBlockDelta(200);

params.getProducer().ethereal().setEpochLength(7).setNumberOfEpochs(3);
return params;
var template = Parameters.newBuilder()
.setGenerateGenesis(true)
.setGenesisViewId(GENESIS_VIEW_ID)
.setBootstrap(Parameters.BootstrapParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.build())
.setGenesisViewId(DigestAlgorithm.DEFAULT.getOrigin())
.setGossipDuration(Duration.ofMillis(50))
.setProducer(Parameters.ProducerParameters.newBuilder()
.setGossipDuration(Duration.ofMillis(50))
.setBatchInterval(Duration.ofMillis(50))
.setMaxBatchByteSize(1024 * 1024)
.setMaxBatchCount(10_000)
.setEthereal(Config.newBuilder()
.setNumberOfEpochs(3)
.setEpochLength(7))
.build())
.setCheckpointBlockDelta(200)
.setDrainPolicy(ExponentialBackoffPolicy.newBuilder()
.setInitialBackoff(Duration.ofMillis(1))
.setMaxBackoff(Duration.ofMillis(1)));
return template;
}
}

0 comments on commit 5fda6e5

Please sign in to comment.