use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class FProposalsPerViewDropperTest method dropping_sync_adversary_should_cause_no_timeouts_because_of_sync_retries.
@Test
public void dropping_sync_adversary_should_cause_no_timeouts_because_of_sync_retries() {
SimulationTest test = bftTestBuilder.addNetworkModule(NetworkDroppers.bftSyncMessagesDropped(0.1)).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 FProposalsPerViewDropperTest method given_incorrect_module_where_vertex_sync_is_disabled__then_test_should_fail_against_drop_proposal_adversary.
/**
* Tests a configuration of 4 nodes with a dropping proposal adversary Test should fail with
* GetVertices RPC disabled
*/
@Test
public void given_incorrect_module_where_vertex_sync_is_disabled__then_test_should_fail_against_drop_proposal_adversary() {
SimulationTest test = bftTestBuilder.addOverrideModuleToAllInitialNodes(new AbstractModule() {
@Override
protected void configure() {
bind(new TypeLiteral<RemoteEventDispatcher<GetVerticesRequest>>() {
}).toInstance((node, request) -> {
});
}
}).build();
final var runningTest = test.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).hasEntrySatisfying(Monitor.CONSENSUS_NO_TIMEOUTS, error -> assertThat(error).isPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class FProposalsPerViewDropperTest method dropping_sync_adversary_with_no_timeout_scheduler_should_cause_timeouts.
@Test
public void dropping_sync_adversary_with_no_timeout_scheduler_should_cause_timeouts() {
SimulationTest test = bftTestBuilder.addNetworkModule(NetworkDroppers.bftSyncMessagesDropped(0.1)).addOverrideModuleToAllInitialNodes(new AbstractModule() {
@Override
protected void configure() {
bind(new TypeLiteral<ScheduledEventDispatcher<VertexRequestTimeout>>() {
}).toInstance((request, millis) -> {
});
}
}).build();
final var runningTest = test.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).hasEntrySatisfying(Monitor.CONSENSUS_NO_TIMEOUTS, error -> assertThat(error).isPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class OneByzantineGenesisTest method given_3_correct_bfts__then_none_committed_invariant_should_fail.
@Test
public void given_3_correct_bfts__then_none_committed_invariant_should_fail() {
SimulationTest bftTest = bftTestBuilder.numNodes(3).addTestModules(ConsensusMonitors.noneCommitted()).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).hasEntrySatisfying(Monitor.CONSENSUS_NONE_COMMITTED, error -> assertThat(error).isPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class OneByzantineGenesisTest method given_2_correct_bfts_and_1_byzantine__then_should_never_make_progress.
@Test
public void given_2_correct_bfts_and_1_byzantine__then_should_never_make_progress() {
SimulationTest bftTest = bftTestBuilder.numNodes(3).addOverrideModuleToInitialNodes(nodes -> ImmutableList.of(nodes.get(0).getPublicKey()), new MockedRecoveryModule(HashUtils.random256())).addTestModules(ConsensusMonitors.noneCommitted()).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> AssertionsForClassTypes.assertThat(err).isEmpty());
}
Aggregations