From e8961aee8082adf5977c325c858e87b6247a8c69 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 14 Nov 2025 10:52:47 +0530 Subject: [PATCH 1/2] fix: Dont fail silently in tests --- frappe/utils/global_search.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/utils/global_search.py b/frappe/utils/global_search.py index 3ddb2d8a26..c9eed3ebb6 100644 --- a/frappe/utils/global_search.py +++ b/frappe/utils/global_search.py @@ -422,6 +422,7 @@ def sync_value_in_queue(value): frappe.cache.lpush("global_search_queue", json.dumps(value)) except redis.exceptions.ConnectionError: # not connected, sync directly + assert not frappe.flags.in_test, "Should not fail silently in tests" sync_value(value) From f7e594a618d51afbd1f5de1063e8be40e4349e93 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 14 Nov 2025 10:54:38 +0530 Subject: [PATCH 2/2] fix: Update value if conflicting --- frappe/utils/global_search.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frappe/utils/global_search.py b/frappe/utils/global_search.py index c9eed3ebb6..03a86e47af 100644 --- a/frappe/utils/global_search.py +++ b/frappe/utils/global_search.py @@ -219,9 +219,15 @@ def insert_values_for_multiple_docs(all_contents): # ignoring duplicate keys for doctype_name frappe.db.multisql( { - "mariadb": """INSERT IGNORE INTO `__global_search` + "mariadb": """INSERT INTO `__global_search` (doctype, name, content, published, title, route) - VALUES {} """.format(", ".join(batch_values)), + VALUES {} + ON DUPLICATE KEY UPDATE + content=VALUE(content), + published=VALUE(published), + title=VALUE(title), + route=VALUE(route) + """.format(", ".join(batch_values)), "postgres": """INSERT INTO `__global_search` (doctype, name, content, published, title, route) VALUES {}