From cbdca6fcc8ae61ed2dbfacca9da1a59c78945045 Mon Sep 17 00:00:00 2001 From: Brian Pearce Date: Mon, 22 May 2023 09:48:40 +0200 Subject: [PATCH] fix: don't use in memory datastores for chat client dht in integration tests (#5399) Description --- Use filestore instead of in memory store for DHT tables. Motivation and Context --- I think at some point the reference to the store is being dropped causing the tables to no longer exist. How Has This Been Tested? --- Locally What process can a PR reviewer use to test or verify this change? --- Run the tests, watch CI. Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify Co-authored-by: SW van Heerden --- integration_tests/src/chat_client.rs | 3 ++- integration_tests/src/chat_ffi.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/integration_tests/src/chat_client.rs b/integration_tests/src/chat_client.rs index 03dcea44d6..71b2db65d5 100644 --- a/integration_tests/src/chat_client.rs +++ b/integration_tests/src/chat_client.rs @@ -30,7 +30,7 @@ use tari_comms::{ peer_manager::{Peer, PeerFeatures}, NodeIdentity, }; -use tari_comms_dht::{store_forward::SafConfig, DhtConfig, NetworkDiscoveryConfig}; +use tari_comms_dht::{store_forward::SafConfig, DbConnectionUrl, DhtConfig, NetworkDiscoveryConfig}; use tari_p2p::{P2pConfig, TcpTransportConfig, TransportConfig}; use crate::{base_node_process::get_base_dir, get_port}; @@ -58,6 +58,7 @@ fn test_config(name: &str, port: u64, identity: &NodeIdentity) -> P2pConfig { let mut config = P2pConfig { datastore_path: temp_dir_path.clone(), dht: DhtConfig { + database_url: DbConnectionUrl::file("dht.sqlite"), network_discovery: NetworkDiscoveryConfig { enabled: true, ..NetworkDiscoveryConfig::default() diff --git a/integration_tests/src/chat_ffi.rs b/integration_tests/src/chat_ffi.rs index 3ed3efd86b..830d11bbd8 100644 --- a/integration_tests/src/chat_ffi.rs +++ b/integration_tests/src/chat_ffi.rs @@ -42,7 +42,7 @@ use tari_comms::{ peer_manager::{Peer, PeerFeatures}, NodeIdentity, }; -use tari_comms_dht::{store_forward::SafConfig, DhtConfig, NetworkDiscoveryConfig}; +use tari_comms_dht::{store_forward::SafConfig, DbConnectionUrl, DhtConfig, NetworkDiscoveryConfig}; use tari_contacts::contacts_service::{service::ContactOnlineStatus, types::Message}; use tari_p2p::{P2pConfig, TcpTransportConfig, TransportConfig}; use tari_utilities::message_format::MessageFormat; @@ -183,6 +183,7 @@ fn test_config(base_dir: &PathBuf, identity: &NodeIdentity) -> P2pConfig { let mut config = P2pConfig { datastore_path: base_dir.clone(), dht: DhtConfig { + database_url: DbConnectionUrl::file("dht.sqlite"), network_discovery: NetworkDiscoveryConfig { enabled: true, ..NetworkDiscoveryConfig::default()