Search in sources :

Example 36 with SimulationTest

use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.

the class SanityTest method sanity_tests_should_pass.

@Test
public void sanity_tests_should_pass() {
    SimulationTest simulationTest = bftTestBuilder.build();
    final var checkResults = simulationTest.run().awaitCompletion();
    assertThat(checkResults).allSatisfy((name, err) -> AssertionsForClassTypes.assertThat(err).isEmpty());
}
Also used : SimulationTest(com.radixdlt.harness.simulation.SimulationTest) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Example 37 with SimulationTest

use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.

the class MovingWindowValidatorsTest method given_correct_3_node_bft_with_4_total_nodes_with_changing_epochs_per_100_views__then_should_pass_bft_and_epoch_invariants.

@Test
public void given_correct_3_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(3, 4)).pacemakerTimeout(1000).addTestModules(ConsensusMonitors.liveness(1, TimeUnit.SECONDS), ConsensusMonitors.epochCeilingView(View.of(100))).build();
    final var checkResults = bftTest.run().awaitCompletion();
    assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
Also used : SimulationTest(com.radixdlt.harness.simulation.SimulationTest) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Example 38 with SimulationTest

use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.

the class OneNodeNeverSendEpochResponseTest 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.build();
    final var checkResults = bftTest.run().awaitCompletion();
    assertThat(checkResults).allSatisfy((name, err) -> AssertionsForClassTypes.assertThat(err).isEmpty());
}
Also used : SimulationTest(com.radixdlt.harness.simulation.SimulationTest) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Example 39 with SimulationTest

use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.

the class RandomValidatorsTest method given_nondeterministic_randomized_validator_sets__then_should_fail.

@Test
public void given_nondeterministic_randomized_validator_sets__then_should_fail() {
    SimulationTest bftTest = bftTestBuilder.ledgerAndEpochs(View.of(100), badRandomEpochToNodesMapper()).build();
    final var checkResults = bftTest.run().awaitCompletion();
    assertThat(checkResults).hasValueSatisfying(new Condition<>(Optional::isPresent, "Has error"));
}
Also used : SimulationTest(com.radixdlt.harness.simulation.SimulationTest) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Example 40 with SimulationTest

use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.

the class RandomValidatorsTest 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 checkResults = simulationTest.run().awaitCompletion();
    assertThat(checkResults).allSatisfy((name, err) -> AssertionsForClassTypes.assertThat(err).isEmpty());
}
Also used : SimulationTest(com.radixdlt.harness.simulation.SimulationTest) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Aggregations

SimulationTest (com.radixdlt.harness.simulation.SimulationTest)43 Test (org.junit.Test)43 NetworkLatencies (com.radixdlt.harness.simulation.NetworkLatencies)10 NetworkOrdering (com.radixdlt.harness.simulation.NetworkOrdering)10 ConsensusMonitors (com.radixdlt.harness.simulation.monitors.consensus.ConsensusMonitors)10 TimeUnit (java.util.concurrent.TimeUnit)10 Builder (com.radixdlt.harness.simulation.SimulationTest.Builder)9 CounterType (com.radixdlt.counters.SystemCounters.CounterType)8 NetworkDroppers (com.radixdlt.harness.simulation.NetworkDroppers)8 LongSummaryStatistics (java.util.LongSummaryStatistics)8 LedgerMonitors (com.radixdlt.harness.simulation.monitors.ledger.LedgerMonitors)7 AbstractModule (com.google.inject.AbstractModule)6 AssertionsForInterfaceTypes.assertThat (org.assertj.core.api.AssertionsForInterfaceTypes.assertThat)6 SyncConfig (com.radixdlt.sync.SyncConfig)5 AssertionsForClassTypes (org.assertj.core.api.AssertionsForClassTypes)5 LogManager (org.apache.logging.log4j.LogManager)4 Logger (org.apache.logging.log4j.Logger)4 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)4 TypeLiteral (com.google.inject.TypeLiteral)3 ProvidesIntoSet (com.google.inject.multibindings.ProvidesIntoSet)3