Skip to content

Commit

Permalink
need to change client pool expected values
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnaveira committed Apr 7, 2022
1 parent 9066c79 commit c6d9cdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions comms/core/src/connectivity/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ async fn pool_management() {
// Drop all connections references
for mut conn in connections {
if conn != important_connection {
assert_eq!(conn.handle_count(), 2);
assert_eq!(conn.handle_count(), 3);
// The peer connection mock does not "automatically" publish event to connectivity manager
conn.disconnect().await.unwrap();
cm_mock_state.publish_event(ConnectionManagerEvent::PeerDisconnected(
Expand All @@ -402,14 +402,14 @@ async fn pool_management() {
}
}

assert_eq!(important_connection.handle_count(), 2);
assert_eq!(important_connection.handle_count(), 3);

let events = collect_try_recv!(event_stream, take = 9, timeout = Duration::from_secs(10));
for event in events {
unpack_enum!(ConnectivityEvent::PeerDisconnected(_) = event);
}

assert_eq!(important_connection.handle_count(), 2);
assert_eq!(important_connection.handle_count(), 3);

let conns = connectivity.get_active_connections().await.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions comms/core/src/protocol/rpc/client/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ mod lazy_pool {
assert_eq!(pool.refresh_num_active_connections(), 1);
async_assert_eventually!(mock_state.num_open_substreams(), expect = 1);
let _rpc_client_lease = pool.get_least_used_or_connect().await.unwrap();
assert_eq!(pool.refresh_num_active_connections(), 1);
async_assert_eventually!(mock_state.num_open_substreams(), expect = 1);
assert_eq!(pool.refresh_num_active_connections(), 2);
async_assert_eventually!(mock_state.num_open_substreams(), expect = 2);
}

#[runtime::test]
Expand Down

0 comments on commit c6d9cdb

Please sign in to comment.