Skip to content

Commit

Permalink
fix(tests): port-allocate tests to avoid conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Aug 3, 2022
1 parent f32877f commit 0f8bee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/sui-core/src/unit_tests/consensus_adapter_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ async fn listen_to_sequenced_transaction() {

#[tokio::test]
async fn submit_transaction_to_consensus() {
// TODO [issue #932]: Use a port allocator to avoid port conflicts.
let consensus_address = "127.0.0.1:12456".parse().unwrap();
let port = sui_config::utils::get_available_port();
let consensus_address = format!("127.0.0.1:{port}").parse().unwrap();
let (tx_consensus_listener, mut rx_consensus_listener) = channel(1);

// Initialize an authority with a (owned) gas object and a shared object; then
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-core/src/unit_tests/consensus_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ async fn listen_to_sequenced_transaction() {

#[tokio::test]
async fn submit_transaction_to_consensus() {
// TODO [issue #932]: Use a port allocator to avoid port conflicts.
let consensus_address: Multiaddr = "/dns/localhost/tcp/12456/http".parse().unwrap();
let port = sui_config::utils::get_available_port();
let consensus_address: Multiaddr = format!("/dns/localhost/tcp/{port}/http").parse().unwrap();
let (tx_consensus_listener, mut rx_consensus_listener) = channel(1);

// Initialize an authority with a (owned) gas object and a shared object; then
Expand Down

0 comments on commit 0f8bee5

Please sign in to comment.