Skip to content

Commit

Permalink
test: fix for fan out
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
zwpaper committed Dec 2, 2024
1 parent 3e510cf commit 87e6f76
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/tabby-index/src/indexer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,18 @@ mod builder_tests {
std::thread::available_parallelism().unwrap().get() * 2,
32,
))
.map(|handler| handler.unwrap())
.collect::<Vec<_>>()
.await
.into_iter()
.filter_map(|x| x)
.collect::<Vec<_>>()
});

// the chunks should be failed as no embedding is provided
// the last element is the document itself
assert_eq!(res.len(), 1);
let doc = res.last().unwrap().as_ref().unwrap().as_ref().unwrap();
let doc = res.last().unwrap();

let schema = IndexSchema::instance();
let failed_count = doc
Expand Down Expand Up @@ -250,16 +254,20 @@ mod builder_tests {
std::thread::available_parallelism().unwrap().get() * 2,
32,
))
.map(|handler| handler.unwrap())
.collect::<Vec<_>>()
.await
.into_iter()
.filter_map(|x| x)
.collect::<Vec<_>>()
});

// The last element is the document itself,
// while the preceding elements are the chunks.
// Given that the embedding is empty,
// all chunks should be considered failed and skipped.
assert_eq!(res.len(), 1);
let doc = res.last().unwrap().as_ref().unwrap().as_ref().unwrap();
let doc = res.last().unwrap();

let schema = IndexSchema::instance();
let failed_count = doc
Expand Down

0 comments on commit 87e6f76

Please sign in to comment.