Search in sources :

Example 41 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 42 with SimulationTest

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

the class MempoolSanityTest method when_submitting_items_to_null_mempool__then_test_should_fail.

/**
 * TODO: This is more of a test for mempoolSubmissionSteadyState, should move somewhere else
 */
@Test
public void when_submitting_items_to_null_mempool__then_test_should_fail() {
    SimulationTest simulationTest = bftTestBuilder.addOverrideModuleToAllInitialNodes(new AbstractModule() {

        @Override
        protected void configure() {
            bind(new TypeLiteral<Mempool<Txn>>() {
            }).toInstance(Mempools.empty());
        }
    }).build();
    final var checkResults = simulationTest.run().awaitCompletion();
    assertThat(checkResults).hasEntrySatisfying(Monitor.MEMPOOL_COMMITTED, error -> assertThat(error).isPresent());
}
Also used : TypeLiteral(com.google.inject.TypeLiteral) SimulationTest(com.radixdlt.harness.simulation.SimulationTest) Txn(com.radixdlt.atom.Txn) AbstractModule(com.google.inject.AbstractModule) Test(org.junit.Test) SimulationTest(com.radixdlt.harness.simulation.SimulationTest)

Example 43 with SimulationTest

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.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)

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