Skip to content

feat: Implement integration test parallel execution#157

Merged
jopemachine merged 3 commits intomainfrom
feat/implement-parallel-test2
Oct 9, 2024
Merged

feat: Implement integration test parallel execution#157
jopemachine merged 3 commits intomainfrom
feat/implement-parallel-test2

Conversation

@jopemachine
Copy link
Member

@jopemachine jopemachine commented Oct 9, 2024

This PR enables parallel execution by removing dependencies between integration tests, isolating the file system and network by using different loopback addresses for each test cluster.

Resolve #95.

Note

Even with this PR applied, due to the limitations of the cargo test command, only the integration tests within the same test binary will be executed in parallel.

Let's introduce the cargo-nextest crate to enable parallel execution of all tests.

❯ cargo nextest run
   Compiling harness v0.1.81 (/home/jopemachine/raftify/harness)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 6.08s
------------
 Nextest run ID ba5aa8b4-21fc-409d-9f14-c1719c741bb8 with nextest profile: default
    Starting 21 tests across 12 binaries
        PASS [   0.003s] raftify peers::tests::test_add_wrong_peer_addr
        PASS [   0.005s] raftify peers::tests::test_peers_serial_reserve_peer
        PASS [   0.054s] raftify storage::heed_storage::test::test_storage_apply_snapshot
        PASS [   0.053s] raftify storage::rocksdb_storage::test::test_storage_apply_snapshot
        PASS [   0.069s] raftify storage::heed_storage::test::test_storage_last_index
        PASS [   0.070s] raftify storage::heed_storage::test::test_storage_first_index
        PASS [   0.122s] raftify storage::heed_storage::test::test_storage_compact
        PASS [   0.128s] raftify storage::heed_storage::test::test_storage_term
        PASS [   0.130s] raftify storage::rocksdb_storage::test::test_storage_compact
        PASS [   0.156s] raftify storage::rocksdb_storage::test::test_storage_append
        PASS [   0.163s] raftify storage::heed_storage::test::test_storage_append
        PASS [   0.108s] raftify storage::rocksdb_storage::test::test_storage_last_index
        PASS [   0.109s] raftify storage::rocksdb_storage::test::test_storage_first_index
        PASS [   0.176s] raftify storage::heed_storage::test::test_storage_entries
        PASS [   0.181s] raftify storage::rocksdb_storage::test::test_storage_entries
        PASS [   0.136s] raftify storage::rocksdb_storage::test::test_storage_term
        PASS [   2.134s] harness::bootstrap test_dynamic_bootstrap
        PASS [   2.213s] harness::bootstrap test_static_bootstrap
        PASS [   2.239s] harness::leader_election test_leader_election_in_three_node_cluster
        PASS [   5.082s] harness::leader_election test_leader_election_in_five_node_cluster
        PASS [   8.094s] harness::data_replication test_data_replication
------------
     Summary [   8.095s] 21 tests run: 21 passed, 0 skipped

@jopemachine jopemachine self-assigned this Oct 9, 2024
@jopemachine jopemachine changed the title feat: Implement parallel test feat: Implement integration test parallel execution Oct 9, 2024
@jopemachine jopemachine force-pushed the feat/implement-parallel-test2 branch from 67a920b to f31d554 Compare October 9, 2024 09:30
@jopemachine jopemachine marked this pull request as ready for review October 9, 2024 09:33
@jopemachine jopemachine merged commit 2173e00 into main Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement integration test parallel execution

1 participant