use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class RandomVoteAndViewTimeoutDropperTest method when_random_validators__then_sanity_checks_should_pass.
@Test
public void when_random_validators__then_sanity_checks_should_pass() {
SimulationTest simulationTest = bftTestBuilder.build();
final var runningTest = simulationTest.run(Duration.of(2, ChronoUnit.MINUTES));
final var checkResults = runningTest.awaitCompletion();
List<CounterType> counterTypes = List.of(CounterType.BFT_VERTEX_STORE_FORKS, CounterType.BFT_COMMITTED_VERTICES, CounterType.BFT_PACEMAKER_TIMEOUTS_SENT, CounterType.LEDGER_STATE_VERSION);
Map<CounterType, LongSummaryStatistics> statistics = counterTypes.stream().collect(Collectors.toMap(counterType -> counterType, counterType -> runningTest.getNetwork().getSystemCounters().values().stream().mapToLong(s -> s.get(counterType)).summaryStatistics()));
System.out.println("statistics:\n" + print(statistics.entrySet()));
assertThat(checkResults).allSatisfy((name, error) -> AssertionsForClassTypes.assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class MempoolSanityTest method when_submitting_items_to_mempool__then_they_should_get_executed.
@Test
public void when_submitting_items_to_mempool__then_they_should_get_executed() {
SimulationTest simulationTest = bftTestBuilder.build();
final var checkResults = simulationTest.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 ByzantineSyncTest method given_a_sometimes_byzantine_sync_layer_with_incorrect_accumulator_verifier__sanity_tests_should_not_pass.
@Test
public void given_a_sometimes_byzantine_sync_layer_with_incorrect_accumulator_verifier__sanity_tests_should_not_pass() {
SimulationTest simulationTest = bftTestBuilder.addOverrideModuleToAllInitialNodes(new IncorrectAlwaysAcceptingAccumulatorVerifierModule()).build();
final var runningTest = simulationTest.run();
final var checkResults = runningTest.awaitCompletion();
LongSummaryStatistics statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> s.get(CounterType.SYNC_VALID_RESPONSES_RECEIVED)).mapToLong(l -> l).summaryStatistics();
logger.info("{}", statistics);
assertThat(checkResults).hasEntrySatisfying(Monitor.LEDGER_IN_ORDER, error -> assertThat(error).isPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class ByzantineSyncTest method given_a_sometimes_byzantine_sync_layer__sanity_tests_should_pass.
@Test
public void given_a_sometimes_byzantine_sync_layer__sanity_tests_should_pass() {
SimulationTest simulationTest = bftTestBuilder.build();
final var runningTest = simulationTest.run();
final var results = runningTest.awaitCompletion();
assertThat(results).allSatisfy((name, err) -> assertThat(err).isEmpty());
LongSummaryStatistics statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> s.get(CounterType.SYNC_VALID_RESPONSES_RECEIVED)).mapToLong(l -> l).summaryStatistics();
logger.info("{}", statistics);
assertThat(statistics.getSum()).isGreaterThan(0L);
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class FNodesNeverReceiveProposalDropperTest method sanity_tests_should_pass.
@Test
public void sanity_tests_should_pass() {
SimulationTest simulationTest = bftTestBuilder.build();
final var runningTest = simulationTest.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
LongSummaryStatistics statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> s.get(CounterType.SYNC_VALID_RESPONSES_RECEIVED)).mapToLong(l -> l).summaryStatistics();
logger.info("{}", statistics);
assertThat(statistics.getSum()).isGreaterThan(0L);
}
Aggregations