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) -> AssertionsForClassTypes.assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class OneSlowNodeTest method given_4_nodes_3_fast_and_1_slow_node_and_sync_disabled__then_a_timeout_wont_occur.
/**
* Tests a static configuration of 3 fast, equal nodes and 1 slow node. Test should pass even with
* GetVertices RPC disabled
*/
@Test
public void given_4_nodes_3_fast_and_1_slow_node_and_sync_disabled__then_a_timeout_wont_occur() {
SimulationTest test = bftTestBuilder.build();
final var runningTest = test.run();
final var checkResults = runningTest.awaitCompletion();
assertThat(checkResults).allSatisfy((name, error) -> AssertionsForClassTypes.assertThat(error).isNotPresent());
}
use of com.radixdlt.harness.simulation.SimulationTest in project radixdlt by radixdlt.
the class RandomLatencyTest method given_3_correct_nodes_in_random_network_and_no_sync__then_all_synchronous_checks_should_pass.
/**
* Tests a static configuration of 3 nodes with random, high variance in latency
*/
@Test
public void given_3_correct_nodes_in_random_network_and_no_sync__then_all_synchronous_checks_should_pass() {
SimulationTest test = bftTestBuilder.numNodes(3).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 RandomVoteAndViewTimeoutDropperTest method sanity_test.
/**
* Tests a configuration of 4 nodes with a dropping proposal adversary Test should fail with
* GetVertices RPC disabled
*/
@Test
public void sanity_test() {
SimulationTest test = bftTestBuilder.build();
final var runningTest = test.run();
final var checkResults = runningTest.awaitCompletion();
LongSummaryStatistics statistics = runningTest.getNetwork().getSystemCounters().values().stream().map(s -> s.get(CounterType.BFT_VERTEX_STORE_FORKS)).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 UniformLatencyTest method given_4_correct_bfts__then_should_pass_sanity_tests_over_1_minute.
/**
* Sanity test check for a perfect network. 4 is the size used because it is the smallest network
* size where quorum size (3) != network size. The sanity checks done are:
*
* <ol>
* <li>Committed vertices are the same across nodes
* <li>The size of vertex store does not increase for any node
* <li>A timeout never occurs for any node
* <li>Every proposal has a direct parent
* </ol>
*/
@Test
public void given_4_correct_bfts__then_should_pass_sanity_tests_over_1_minute() {
SimulationTest bftTest = SimulationTest.builder().networkModules(NetworkOrdering.inOrder(), NetworkLatencies.fixed()).numNodes(4).addTestModules(ConsensusMonitors.safety(), ConsensusMonitors.liveness(LIVENESS_MS, TimeUnit.MILLISECONDS), ConsensusMonitors.directParents()).build();
final var checkResults = bftTest.run().awaitCompletion();
assertThat(checkResults).allSatisfy((name, err) -> assertThat(err).isEmpty());
}
Aggregations