refactor: expose test fuzz owner symbols (#3752)

This commit is contained in:
Zhengchao An
2026-06-23 01:11:46 +08:00
committed by GitHub
parent 6da61b44e5
commit e0b79aa00c
11 changed files with 156 additions and 169 deletions
+4 -10
View File
@@ -14,19 +14,13 @@
//! test endpoint index settings
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::layout as ecstore_layout;
use rustfs_ecstore::api::storage as ecstore_storage;
use rustfs_ecstore::api::disk::endpoint::Endpoint;
use rustfs_ecstore::api::layout::{EndpointServerPools, Endpoints, PoolEndpoints};
use rustfs_ecstore::api::storage::{ECStore, init_local_disks};
use std::net::SocketAddr;
use tempfile::TempDir;
use tokio_util::sync::CancellationToken;
type ECStore = ecstore_storage::ECStore;
type Endpoint = ecstore_disk::endpoint::Endpoint;
type EndpointServerPools = ecstore_layout::EndpointServerPools;
type Endpoints = ecstore_layout::Endpoints;
type PoolEndpoints = ecstore_layout::PoolEndpoints;
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn test_endpoint_index_settings() -> anyhow::Result<()> {
let temp_dir = TempDir::new()?;
@@ -78,7 +72,7 @@ async fn test_endpoint_index_settings() -> anyhow::Result<()> {
}
// test ECStore initialization
ecstore_storage::init_local_disks(endpoint_pools.clone()).await?;
init_local_disks(endpoint_pools.clone()).await?;
let server_addr: SocketAddr = "127.0.0.1:0".parse().unwrap();
let ecstore = ECStore::new(server_addr, endpoint_pools, CancellationToken::new()).await?;
+1 -4
View File
@@ -12,16 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::disk::{DiskStore, endpoint::Endpoint};
use rustfs_heal::heal::{
event::{HealEvent, Severity},
task::{HealPriority, HealType},
utils,
};
type DiskStore = ecstore_disk::DiskStore;
type Endpoint = ecstore_disk::endpoint::Endpoint;
#[test]
fn test_heal_event_to_heal_request_no_panic() {
// Test that invalid pool/set indices don't cause panic
+6 -12
View File
@@ -14,10 +14,10 @@
use http::HeaderMap;
use rustfs_common::heal_channel::{HealOpts, HealScanMode};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::layout as ecstore_layout;
use rustfs_ecstore::api::storage as ecstore_storage;
use rustfs_ecstore::api::bucket::metadata_sys::init_bucket_metadata_sys;
use rustfs_ecstore::api::disk::endpoint::Endpoint;
use rustfs_ecstore::api::layout::{EndpointServerPools, Endpoints, PoolEndpoints};
use rustfs_ecstore::api::storage::{ECStore, init_local_disks};
use rustfs_heal::heal::{
manager::{HealConfig, HealManager},
storage::{ECStoreHealStorage, HealObjectOptions as ObjectOptions, HealPutObjReader as PutObjReader, HealStorageAPI},
@@ -39,12 +39,6 @@ const HEAL_FORMAT_WAIT_TIMEOUT: Duration = Duration::from_secs(25);
const HEAL_FORMAT_WAIT_INTERVAL: Duration = Duration::from_millis(250);
const NON_INLINE_TEST_DATA_SIZE: usize = 256 * 1024 + 137;
type ECStore = ecstore_storage::ECStore;
type Endpoint = ecstore_disk::endpoint::Endpoint;
type EndpointServerPools = ecstore_layout::EndpointServerPools;
type Endpoints = ecstore_layout::Endpoints;
type PoolEndpoints = ecstore_layout::PoolEndpoints;
fn non_inline_test_data() -> Vec<u8> {
(0..NON_INLINE_TEST_DATA_SIZE).map(|idx| (idx % 251) as u8).collect()
}
@@ -127,7 +121,7 @@ async fn setup_test_env() -> (Vec<PathBuf>, Arc<ECStore>, Arc<ECStoreHealStorage
let endpoint_pools = EndpointServerPools::from(vec![pool_endpoints]);
// format disks (only first time)
ecstore_storage::init_local_disks(endpoint_pools.clone()).await.unwrap();
init_local_disks(endpoint_pools.clone()).await.unwrap();
// create ECStore with dynamic port 0 (let OS assign) or fixed 9001 if free
let port = 9001; // for simplicity
@@ -145,7 +139,7 @@ async fn setup_test_env() -> (Vec<PathBuf>, Arc<ECStore>, Arc<ECStoreHealStorage
.await
.unwrap();
let buckets = buckets_list.into_iter().map(|v| v.name).collect();
ecstore_bucket::metadata_sys::init_bucket_metadata_sys(ecstore.clone(), buckets).await;
init_bucket_metadata_sys(ecstore.clone(), buckets).await;
// Create heal storage layer
let heal_storage = Arc::new(ECStoreHealStorage::new(ecstore.clone()));