use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class MovingWindowValidatorsTest method given_correct_1_node_bft_with_4_total_nodes_with_changing_epochs_per_100_views__then_should_pass_bft_and_epoch_invariants.
@Test
public void given_correct_1_node_bft_with_4_total_nodes_with_changing_epochs_per_100_views__then_should_pass_bft_and_epoch_invariants() {
SimulationTest bftTest = bftTestBuilder.numNodes(4).ledgerAndEpochs(View.of(100), windowedEpochToNodesMapper(1, 4)).pacemakerTimeout(5000).addTestModules(ConsensusMonitors.liveness(5, TimeUnit.SECONDS), ConsensusMonitors.epochCeilingView(View.of(100))).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class RandomValidatorsTest method given_deterministic_randomized_validator_sets__then_should_pass_bft_and_epoch_invariants.
@Test
public void given_deterministic_randomized_validator_sets__then_should_pass_bft_and_epoch_invariants() {
SimulationTest bftTest = bftTestBuilder.ledgerAndEpochs(View.of(100), goodRandomEpochToNodesMapper()).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> AssertionsForClassTypes.assertThat(err).isEmpty());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class IncreasingValidatorsTest method when_increasing_validators__then_they_should_be_getting_registered.
@Test
public void when_increasing_validators__then_they_should_be_getting_registered() {
SimulationTest simulationTest = bftTestBuilder.build();
final var runningTest = simulationTest.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class FPlusOneOutOfBoundsTest method given_1_out_of_3_nodes_out_of_synchrony_bounds.
/**
* Tests a configuration of 1 out of 3 nodes out of synchrony bounds
*/
@Test
public void given_1_out_of_3_nodes_out_of_synchrony_bounds() {
SimulationTest test = bftTestBuilder.numNodes(3).networkModules(NetworkOrdering.inOrder(), NetworkLatencies.oneOutOfBounds(LATENCY_MS, LIVENESS_MS)).build();
final var runningTest = test.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).hasEntrySatisfying(Monitor.CONSENSUS_LIVENESS, error -> assertThat(error).isPresent()).hasEntrySatisfying(Monitor.CONSENSUS_SAFETY, error -> assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class OneByzantineGenesisTest method given_3_correct_bfts_and_1_byzantine__then_should_make_progress.
@Test
public void given_3_correct_bfts_and_1_byzantine__then_should_make_progress() {
SimulationTest bftTest = bftTestBuilder.numNodes(4).addOverrideModuleToInitialNodes(nodes -> ImmutableList.of(nodes.get(0).getPublicKey()), new MockedRecoveryModule(HashUtils.random256())).addTestModules(ConsensusMonitors.liveness(5, TimeUnit.SECONDS)).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
Aggregations