Skip to content

Commit

Permalink
fix coverage run (#2232)
Browse files Browse the repository at this point in the history
coverage run uses the compare_hash_only feature which is not compativle
with the test_hashmap_size test
  • Loading branch information
PSeitz authored Nov 6, 2023
1 parent 7bc5bf7 commit 2e73272
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ unstable = [] # useful for benches.

quickwit = ["sstable", "futures-util"]

# Compares only the hash of a string when indexing data.
# Increases indexing speed, but may lead to extremely rare missing terms, when there's a hash collision.
# Uses 64bit ahash.
compare_hash_only = ["stacker/compare_hash_only"]

[workspace]
members = ["query-grammar", "bitpacker", "common", "ownedbytes", "stacker", "sstable", "tokenizer-api", "columnar"]

Expand Down
3 changes: 2 additions & 1 deletion src/indexer/segment_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ mod tests {

use tempfile::TempDir;

use super::compute_initial_table_size;
use crate::collector::{Count, TopDocs};
use crate::core::json_utils::JsonTermWriter;
use crate::directory::RamDirectory;
Expand All @@ -516,7 +515,9 @@ mod tests {
};

#[test]
#[cfg(not(feature = "compare_hash_only"))]
fn test_hashmap_size() {
use super::compute_initial_table_size;
assert_eq!(compute_initial_table_size(100_000).unwrap(), 1 << 12);
assert_eq!(compute_initial_table_size(1_000_000).unwrap(), 1 << 15);
assert_eq!(compute_initial_table_size(15_000_000).unwrap(), 1 << 19);
Expand Down

0 comments on commit 2e73272

Please sign in to comment.