Skip to content

Commit 583e4cb

Browse files
committed
fixing test warnings
1 parent 1829142 commit 583e4cb

File tree

11 files changed

+38
-41
lines changed

11 files changed

+38
-41
lines changed

helix-db/Cargo.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,3 @@ dev = ["debug-output", "server", "bench"]
8585
dev-instance = []
8686
default = ["server"]
8787
production = ["api-key","server"]
88-
89-
# benches/tests
90-
[[test]]
91-
name = "bm25_benches"
92-
path = "benches/bm25_benches.rs"
93-
94-
[[test]]
95-
name = "hnsw_benches"
96-
path = "benches/hnsw_benches.rs"
97-

helix-db/src/helix_engine/storage_core/storage_migration_tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ fn populate_old_properties(
136136
}
137137

138138
/// Set storage metadata to a specific state
139+
#[allow(dead_code)]
139140
fn set_metadata(
140141
storage: &mut HelixGraphStorage,
141142
metadata: StorageMetadata,
@@ -396,7 +397,7 @@ fn test_convert_old_properties_invalid_bincode() {
396397

397398
#[test]
398399
fn test_migrate_empty_database() {
399-
let (mut storage, _temp_dir) = setup_test_storage();
400+
let (storage, _temp_dir) = setup_test_storage();
400401

401402
// Storage is already created with migrations run, but let's verify the state
402403
let txn = storage.graph_env.read_txn().unwrap();

helix-db/src/helix_engine/tests/concurrency_tests/hnsw_concurrent_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ fn test_concurrent_inserts_single_label() {
8383
let barrier = Arc::new(Barrier::new(num_threads));
8484

8585
let handles: Vec<_> = (0..num_threads)
86-
.map(|thread_id| {
86+
.map(|_thread_id| {
8787
let env = Arc::clone(&env);
8888
let barrier = Arc::clone(&barrier);
8989

9090
thread::spawn(move || {
9191
// Wait for all threads to be ready
9292
barrier.wait();
9393

94-
for i in 0..vectors_per_thread {
94+
for _i in 0..vectors_per_thread {
9595
// Each insert needs its own write transaction (serialized by LMDB)
9696
let mut wtxn = env.write_txn().unwrap();
9797
let arena = Bump::new();
@@ -236,14 +236,14 @@ fn test_concurrent_searches_during_inserts() {
236236
}
237237

238238
// Spawn writer threads
239-
for writer_id in 0..num_writers {
239+
for _writer_id in 0..num_writers {
240240
let env = Arc::clone(&env);
241241
let barrier = Arc::clone(&barrier);
242242

243243
handles.push(thread::spawn(move || {
244244
barrier.wait();
245245

246-
for i in 0..25 {
246+
for _i in 0..25 {
247247
let mut wtxn = env.write_txn().unwrap();
248248
let arena = Bump::new();
249249

helix-db/src/helix_engine/tests/concurrency_tests/hnsw_loom_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ fn loom_graph_operation_ordering() {
273273

274274
#[test]
275275
fn loom_two_writers_one_reader() {
276-
/// Model of two writers and one reader accessing shared counter
277-
///
278-
/// Tests MVCC-like behavior where reader should see consistent state
276+
// Model of two writers and one reader accessing shared counter
277+
//
278+
// Tests MVCC-like behavior where reader should see consistent state
279279

280280
loom::model(|| {
281281
let value = Arc::new(AtomicU64::new(0));

helix-db/src/helix_engine/tests/concurrency_tests/integration_stress_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn test_stress_rapid_graph_growth() {
251251
assert!(total_reads > 100, "Should perform many traversals");
252252

253253
// Verify graph integrity
254-
let arena = Bump::new();
254+
let _arena = Bump::new();
255255
let rtxn = storage.graph_env.read_txn().unwrap();
256256
let final_node_count = storage.nodes_db.len(&rtxn).unwrap();
257257
let final_edge_count = storage.edges_db.len(&rtxn).unwrap();

helix-db/src/helix_engine/tests/concurrency_tests/traversal_concurrent_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn test_concurrent_node_additions() {
8282
}
8383

8484
// Verify: All nodes created
85-
let arena = Bump::new();
85+
let _arena = Bump::new();
8686
let rtxn = storage.graph_env.read_txn().unwrap();
8787
let count = storage.nodes_db.len(&rtxn).unwrap();
8888
assert_eq!(

helix-db/src/helix_engine/tests/traversal_tests/count_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use crate::{
2222
use rand::Rng;
2323
use tempfile::TempDir;
2424
use bumpalo::Bump;
25-
use tokio::time;
2625
fn setup_test_db() -> (TempDir, Arc<HelixGraphStorage>) {
2726
let temp_dir = TempDir::new().unwrap();
2827
let db_path = temp_dir.path().to_str().unwrap();

helix-db/src/protocol/custom_serde/error_handling_tests.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ mod error_handling_tests {
7777
}
7878

7979
let arena2 = Bump::new();
80-
let result = Node::from_bincode_bytes(id, &bytes, &arena2);
80+
let _result = Node::from_bincode_bytes(id, &bytes, &arena2);
8181
// May or may not fail depending on where corruption occurs
8282
// This test documents behavior
8383
}
@@ -98,7 +98,7 @@ mod error_handling_tests {
9898
let id = 55555u128;
9999
let zeros = vec![0u8; 100];
100100

101-
let result = Node::from_bincode_bytes(id, &zeros, &arena);
101+
let _result = Node::from_bincode_bytes(id, &zeros, &arena);
102102
// This might actually deserialize to some default values
103103
// Test documents behavior
104104
}
@@ -168,7 +168,7 @@ mod error_handling_tests {
168168
}
169169

170170
let arena2 = Bump::new();
171-
let result = Edge::from_bincode_bytes(id, &bytes, &arena2);
171+
let _result = Edge::from_bincode_bytes(id, &bytes, &arena2);
172172
// Might succeed with corrupted IDs - test documents behavior
173173
}
174174

@@ -188,7 +188,7 @@ mod error_handling_tests {
188188
let id = 333444u128;
189189
let zeros = vec![0u8; 100];
190190

191-
let result = Edge::from_bincode_bytes(id, &zeros, &arena);
191+
let _result = Edge::from_bincode_bytes(id, &zeros, &arena);
192192
// May deserialize with zero values - test documents behavior
193193
}
194194

@@ -218,7 +218,7 @@ mod error_handling_tests {
218218
let empty_data: &[u8] = &[];
219219

220220
let arena2 = Bump::new();
221-
let result = HVector::from_bincode_bytes(&arena2, Some(&props_bytes), empty_data, id);
221+
let _result = HVector::from_bincode_bytes(&arena2, Some(&props_bytes), empty_data, id);
222222
// Should panic due to assertion in cast_raw_vector_data
223223
}
224224

@@ -271,10 +271,10 @@ mod error_handling_tests {
271271
let arena = Bump::new();
272272
let id = 888999u128;
273273
let vector = create_simple_vector(&arena, id, "test", &[1.0]);
274-
let props_bytes = bincode::serialize(&vector).unwrap();
275-
let single_byte: &[u8] = &[0x42];
274+
let _props_bytes = bincode::serialize(&vector).unwrap();
275+
let _single_byte: &[u8] = &[0x42];
276276

277-
let arena2 = Bump::new();
277+
let _arena2 = Bump::new();
278278
// Should panic due to misalignment
279279
}
280280

@@ -299,7 +299,7 @@ mod error_handling_tests {
299299
}
300300

301301
let arena2 = Bump::new();
302-
let result = Node::from_bincode_bytes(id, &bytes, &arena2);
302+
let _result = Node::from_bincode_bytes(id, &bytes, &arena2);
303303
// Behavior depends on exact corruption
304304
}
305305

@@ -319,7 +319,7 @@ mod error_handling_tests {
319319
}
320320

321321
let arena2 = Bump::new();
322-
let result = Edge::from_bincode_bytes(id, &bytes, &arena2);
322+
let _result = Edge::from_bincode_bytes(id, &bytes, &arena2);
323323
// May fail on UTF-8 validation
324324
}
325325

@@ -345,7 +345,7 @@ mod error_handling_tests {
345345
}
346346

347347
let arena2 = Bump::new();
348-
let result = Node::from_bincode_bytes(id, &bytes, &arena2);
348+
let _result = Node::from_bincode_bytes(id, &bytes, &arena2);
349349
// Should fail on UTF-8 validation
350350
}
351351

@@ -364,7 +364,7 @@ mod error_handling_tests {
364364
}
365365

366366
let arena2 = Bump::new();
367-
let result = Edge::from_bincode_bytes(id, &bytes, &arena2);
367+
let _result = Edge::from_bincode_bytes(id, &bytes, &arena2);
368368
// Should fail on UTF-8 validation
369369
}
370370

@@ -384,7 +384,7 @@ mod error_handling_tests {
384384
}
385385

386386
let arena2 = Bump::new();
387-
let result = HVector::from_bincode_bytes(&arena2, Some(&props_bytes), data_bytes, id);
387+
let _result = HVector::from_bincode_bytes(&arena2, Some(&props_bytes), data_bytes, id);
388388
// Should fail on UTF-8 validation
389389
}
390390

@@ -404,7 +404,7 @@ mod error_handling_tests {
404404
}
405405

406406
let arena2 = Bump::new();
407-
let result = Node::from_bincode_bytes(id, &bytes, &arena2);
407+
let _result = Node::from_bincode_bytes(id, &bytes, &arena2);
408408
// May fail on UTF-8 validation
409409
}
410410

@@ -425,7 +425,7 @@ mod error_handling_tests {
425425
}
426426

427427
let arena2 = Bump::new();
428-
let result = Edge::from_bincode_bytes(id, &bytes, &arena2);
428+
let _result = Edge::from_bincode_bytes(id, &bytes, &arena2);
429429
// May fail during property deserialization
430430
}
431431

helix-db/src/protocol/custom_serde/test_utils.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ pub fn nested_value_props() -> Vec<(&'static str, Value)> {
378378
}
379379

380380
/// Creates a large number of properties for stress testing
381+
#[allow(dead_code)]
381382
pub fn many_props(count: usize) -> Vec<(String, Value)> {
382383
(0..count)
383384
.map(|i| (format!("key_{}", i), Value::I32(i as i32)))
@@ -487,6 +488,7 @@ pub fn assert_vectors_semantically_equal(vec1: &HVector, vec2: &HVector) {
487488
// ============================================================================
488489

489490
/// Prints byte-level comparison of two byte arrays
491+
#[allow(dead_code)]
490492
pub fn print_byte_comparison(label: &str, bytes1: &[u8], bytes2: &[u8]) {
491493
println!("\n=== {} ===", label);
492494
println!("Bytes1 ({} total): {:02x?}", bytes1.len(), bytes1);
@@ -513,6 +515,7 @@ pub fn print_byte_comparison(label: &str, bytes1: &[u8], bytes2: &[u8]) {
513515
}
514516

515517
/// Prints human-readable interpretation of bytes
518+
#[allow(dead_code)]
516519
pub fn print_byte_interpretation(label: &str, bytes: &[u8]) {
517520
println!("\n{} as string interpretation:", label);
518521
for (i, byte) in bytes.iter().enumerate() {
@@ -533,6 +536,7 @@ pub fn print_byte_interpretation(label: &str, bytes: &[u8]) {
533536
// ============================================================================
534537

535538
/// Generates a random string of given length
539+
#[allow(dead_code)]
536540
pub fn random_string(len: usize) -> String {
537541
use rand::Rng;
538542
let mut rng = rand::rng();
@@ -542,6 +546,7 @@ pub fn random_string(len: usize) -> String {
542546
}
543547

544548
/// Generates random valid UTF-8 strings including Unicode
549+
#[allow(dead_code)]
545550
pub fn random_utf8_string(len: usize) -> String {
546551
use rand::Rng;
547552
let mut rng = rand::rng();
@@ -552,13 +557,15 @@ pub fn random_utf8_string(len: usize) -> String {
552557
}
553558

554559
/// Generates a random f64 vector of given dimensions
560+
#[allow(dead_code)]
555561
pub fn random_f64_vector(dimensions: usize) -> Vec<f64> {
556562
use rand::Rng;
557563
let mut rng = rand::rng();
558564
(0..dimensions).map(|_| rng.random_range(-1.0..1.0)).collect()
559565
}
560566

561567
/// Generates a random Value for property testing
568+
#[allow(dead_code)]
562569
pub fn random_value() -> Value {
563570
use rand::Rng;
564571
let mut rng = rand::rng();

helix-db/src/protocol/custom_serde/vector_serde_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod vector_serialization_tests {
1616
use crate::helix_engine::vector_core::vector::HVector;
1717
use crate::helix_engine::vector_core::vector_without_data::VectorWithoutData;
1818
use crate::protocol::value::Value;
19-
use bincode::Options;
19+
2020
use bumpalo::Bump;
2121

2222
// ========================================================================

0 commit comments

Comments
 (0)