From 53cd2e5605b856300137895b5fd294244c67cc55 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 23 Dec 2022 16:18:22 -0300 Subject: [PATCH] Regenerate initial model in asymmetric reload test to reduce flakyness - Fix logger message when converting org node to entries - Remove unused import from conftest --- src/processor/org_mode/org_to_jsonl.py | 2 +- tests/conftest.py | 1 - tests/test_text_search.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/processor/org_mode/org_to_jsonl.py b/src/processor/org_mode/org_to_jsonl.py index 4a4bd598..313c9a3f 100644 --- a/src/processor/org_mode/org_to_jsonl.py +++ b/src/processor/org_mode/org_to_jsonl.py @@ -41,7 +41,7 @@ class OrgToJsonl(TextToJsonl): start = time.time() current_entries = self.convert_org_nodes_to_entries(entry_nodes, file_to_entries, index_heading_entries) end = time.time() - logger.debug(f"Convert OrgNodes into entry dictionaries: {end - start} seconds") + logger.debug(f"Convert OrgNodes into list of entries: {end - start} seconds") start = time.time() current_entries = self.split_entries_by_max_tokens(current_entries, max_tokens=256) diff --git a/tests/conftest.py b/tests/conftest.py index 103a28e8..ec87f964 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,6 @@ import pytest # Internal Packages from src.search_type import image_search, text_search -from src.utils.config import SearchType from src.utils.helpers import resolve_absolute_path from src.utils.rawconfig import ContentConfig, TextContentConfig, ImageContentConfig, SearchConfig, TextSearchConfig, ImageSearchConfig from src.processor.org_mode.org_to_jsonl import OrgToJsonl diff --git a/tests/test_text_search.py b/tests/test_text_search.py index 1a1d65d9..528b2f31 100644 --- a/tests/test_text_search.py +++ b/tests/test_text_search.py @@ -116,7 +116,7 @@ def test_entry_chunking_by_max_tokens(content_config: ContentConfig, search_conf # ---------------------------------------------------------------------------------------------------- def test_asymmetric_reload(content_config: ContentConfig, search_config: SearchConfig): # Arrange - initial_notes_model= text_search.setup(OrgToJsonl, content_config.org, search_config.asymmetric, regenerate=False) + initial_notes_model= text_search.setup(OrgToJsonl, content_config.org, search_config.asymmetric, regenerate=True) assert len(initial_notes_model.entries) == 10 assert len(initial_notes_model.corpus_embeddings) == 10