From 87e6f76f4788ff0ef48d7d8bc614594b03371cb2 Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Mon, 2 Dec 2024 17:52:02 +0800 Subject: [PATCH] test: fix for fan out Signed-off-by: Wei Zhang --- crates/tabby-index/src/indexer_tests.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/tabby-index/src/indexer_tests.rs b/crates/tabby-index/src/indexer_tests.rs index 989825491bb..26a85b98f12 100644 --- a/crates/tabby-index/src/indexer_tests.rs +++ b/crates/tabby-index/src/indexer_tests.rs @@ -195,14 +195,18 @@ mod builder_tests { std::thread::available_parallelism().unwrap().get() * 2, 32, )) + .map(|handler| handler.unwrap()) .collect::>() .await + .into_iter() + .filter_map(|x| x) + .collect::>() }); // 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 @@ -250,8 +254,12 @@ mod builder_tests { std::thread::available_parallelism().unwrap().get() * 2, 32, )) + .map(|handler| handler.unwrap()) .collect::>() .await + .into_iter() + .filter_map(|x| x) + .collect::>() }); // The last element is the document itself, @@ -259,7 +267,7 @@ mod builder_tests { // 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