From fce4f3f346a7aa4f89eb5f4dd999ec4c93f10265 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 19 Jul 2023 14:40:15 -0400 Subject: [PATCH 1/2] test: Remove outdated test comments This is not at all what this test is doing; probably copypasta --- ingester/src/buffer_tree/root.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ingester/src/buffer_tree/root.rs b/ingester/src/buffer_tree/root.rs index 299d3502d2..2d624ee729 100644 --- a/ingester/src/buffer_tree/root.rs +++ b/ingester/src/buffer_tree/root.rs @@ -998,12 +998,8 @@ mod tests { assert_eq!(m, 1, "tables counter mismatch"); } - /// Assert that multiple writes to a single namespace/table results in a - /// single namespace being created, and matching metrics. #[tokio::test] async fn test_partition_iter() { - // Configure the mock partition provider to return a single partition, named - // p1. let partition_provider = Arc::new( MockPartitionProvider::default() .with_partition( From 3dd29384edc6206bc86d946b727b7c01d19964a8 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 20 Jul 2023 10:51:02 -0400 Subject: [PATCH 2/2] fix: Remove unneeded allow unused_imports and remove unused imports --- ingester/src/buffer_tree/partition/resolver/cache.rs | 5 ++--- ingester/src/buffer_tree/partition/resolver/coalesce.rs | 4 +--- ingester/src/buffer_tree/partition/resolver/mod.rs | 2 -- ingester/src/buffer_tree/partition/resolver/trait.rs | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ingester/src/buffer_tree/partition/resolver/cache.rs b/ingester/src/buffer_tree/partition/resolver/cache.rs index 047d9176b1..78a32e11e0 100644 --- a/ingester/src/buffer_tree/partition/resolver/cache.rs +++ b/ingester/src/buffer_tree/partition/resolver/cache.rs @@ -2,9 +2,7 @@ use std::{collections::HashMap, sync::Arc, time::Duration}; use async_trait::async_trait; use backoff::BackoffConfig; -use data_types::{ - NamespaceId, Partition, PartitionHashId, PartitionId, PartitionKey, SequenceNumber, TableId, -}; +use data_types::{NamespaceId, Partition, PartitionHashId, PartitionId, PartitionKey, TableId}; use iox_catalog::interface::Catalog; use observability_deps::tracing::debug; use parking_lot::Mutex; @@ -222,6 +220,7 @@ mod tests { // Harmless in tests - saves a bunch of extra vars. #![allow(clippy::await_holding_lock)] + use data_types::PartitionId; use iox_catalog::mem::MemCatalog; use super::*; diff --git a/ingester/src/buffer_tree/partition/resolver/coalesce.rs b/ingester/src/buffer_tree/partition/resolver/coalesce.rs index 57b6673e08..5b0a492b9b 100644 --- a/ingester/src/buffer_tree/partition/resolver/coalesce.rs +++ b/ingester/src/buffer_tree/partition/resolver/coalesce.rs @@ -6,7 +6,6 @@ use std::{ }, }; -use arrow::compute::kernels::partition; use async_trait::async_trait; use data_types::{NamespaceId, PartitionKey, TableId}; use futures::{future::Shared, FutureExt}; @@ -267,12 +266,11 @@ mod tests { use assert_matches::assert_matches; use futures::Future; use futures::{stream::FuturesUnordered, StreamExt}; - use lazy_static::lazy_static; use test_helpers::timeout::FutureTimeout; use tokio::sync::{Notify, Semaphore}; use crate::{ - buffer_tree::partition::{resolver::mock::MockPartitionProvider, SortKeyState}, + buffer_tree::partition::resolver::mock::MockPartitionProvider, test_util::{ defer_namespace_name_1_sec, defer_table_metadata_1_sec, PartitionDataBuilder, ARBITRARY_NAMESPACE_ID, ARBITRARY_PARTITION_KEY, ARBITRARY_TABLE_ID, diff --git a/ingester/src/buffer_tree/partition/resolver/mod.rs b/ingester/src/buffer_tree/partition/resolver/mod.rs index bc0ea78ae8..2343bf181f 100644 --- a/ingester/src/buffer_tree/partition/resolver/mod.rs +++ b/ingester/src/buffer_tree/partition/resolver/mod.rs @@ -2,8 +2,6 @@ //! //! [`PartitionData`]: crate::buffer_tree::partition::PartitionData -#![allow(unused_imports)] // Transition time only. - mod cache; pub(crate) use cache::*; diff --git a/ingester/src/buffer_tree/partition/resolver/trait.rs b/ingester/src/buffer_tree/partition/resolver/trait.rs index e525cd5a6f..e6c8276117 100644 --- a/ingester/src/buffer_tree/partition/resolver/trait.rs +++ b/ingester/src/buffer_tree/partition/resolver/trait.rs @@ -49,11 +49,11 @@ where #[cfg(test)] mod tests { - use std::{sync::Arc, time::Duration}; + use std::sync::Arc; use super::*; use crate::{ - buffer_tree::partition::{resolver::mock::MockPartitionProvider, SortKeyState}, + buffer_tree::partition::resolver::mock::MockPartitionProvider, test_util::{ defer_namespace_name_1_sec, defer_table_metadata_1_sec, PartitionDataBuilder, ARBITRARY_NAMESPACE_ID, ARBITRARY_PARTITION_ID, ARBITRARY_PARTITION_KEY,