use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class OneNodeFallingBehindTest method sanity_test.
@Test
public void sanity_test() {
SimulationTest test = bftTestBuilder.build();
final var runningTest = test.run(Duration.ofSeconds(60));
final var checkResults = runningTest.awaitCompletion();
LongSummaryStatistics statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> s.get(CounterType.BFT_SYNC_REQUESTS_SENT)).mapToLong(l -> l).summaryStatistics();
System.out.println(statistics);
assertThat(checkResults).allSatisfy((name, error) -> AssertionsForClassTypes.assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class OneOutOfBoundsTest method given_1_out_of_4_nodes_out_of_synchrony_bounds.
/**
* Tests a configuration of 1 out of 4 nodes out of synchrony bounds
*/
@Test
public void given_1_out_of_4_nodes_out_of_synchrony_bounds() {
SimulationTest test = bftTestBuilder.numNodes(4).build();
final var runningTest = test.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).allSatisfy((name, error) -> assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class TimeoutPreviousVoteWithDroppedProposalsTest method sanity_test.
@Test
public void sanity_test() {
SimulationTest test = bftTestBuilder.build();
final var runningTest = test.run(Duration.ofSeconds(10));
final var results = runningTest.awaitCompletion();
final var statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> LongStream.of(s.get(CounterType.BFT_PACEMAKER_TIMEOUTS_SENT), s.get(CounterType.BFT_PACEMAKER_TIMED_OUT_ROUNDS))).map(LongStream::summaryStatistics).collect(ImmutableList.toImmutableList());
statistics.forEach(s -> {
// to make sure we've processed some views
assertTrue(s.getMin() > 2);
// this ensures that we only need a single timeout per view
// BFT_TIMEOUT equal to BFT_TIMED_OUT_VIEWS
assertEquals(s.getMin(), s.getMax());
});
assertThat(results).allSatisfy((name, error) -> AssertionsForClassTypes.assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class MovingWindowValidatorsTest method given_correct_25_node_bft_with_50_total_nodes_with_changing_epochs_per_100_views__then_should_pass_bft_and_epoch_invariants.
@Test
public void given_correct_25_node_bft_with_50_total_nodes_with_changing_epochs_per_100_views__then_should_pass_bft_and_epoch_invariants() {
SimulationTest bftTest = bftTestBuilder.numNodes(100).ledgerAndEpochs(View.of(100), windowedEpochToNodesMapper(25, 50)).pacemakerTimeout(5000).addTestModules(ConsensusMonitors.liveness(5, // High timeout to make Travis happy
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 MovingWindowValidatorsTest method given_correct_25_node_bft_with_50_total_nodes_with_changing_epochs_per_1_view__then_should_pass_bft_and_epoch_invariants.
@Test
public void given_correct_25_node_bft_with_50_total_nodes_with_changing_epochs_per_1_view__then_should_pass_bft_and_epoch_invariants() {
SimulationTest bftTest = bftTestBuilder.numNodes(100).ledgerAndEpochs(View.of(1), windowedEpochToNodesMapper(25, 50)).pacemakerTimeout(5000).addTestModules(ConsensusMonitors.epochCeilingView(View.of(1)), // High timeout to make Travis happy
ConsensusMonitors.liveness(5, TimeUnit.SECONDS)).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
Aggregations