From 179f61b2e1dfa1e6b1454a041c444ca8a0de7d0a Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 1 Apr 2022 17:02:29 +0530 Subject: [PATCH] fix(test): Commit post global_search.sync_global_search This is an attempt to tackle the flaky test_delete_doc test. Not sure if this will do anything but the other tests seem to be having a commit directly after the sync...so following that here. If this works, the goal would be to find a way to get rid of the commits altogether. Since the flaky test can't be replicated locally, let's see if this works !!!! --- frappe/tests/test_global_search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/tests/test_global_search.py b/frappe/tests/test_global_search.py index 448ad68810..0faff55e7f 100644 --- a/frappe/tests/test_global_search.py +++ b/frappe/tests/test_global_search.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import unittest @@ -89,6 +89,7 @@ class TestGlobalSearch(unittest.TestCase): frappe.delete_doc('Event', event_name) global_search.sync_global_search() + frappe.db.commit() results = global_search.search(test_subject) self.assertTrue(all(r["name"] != event_name for r in results), msg="Deleted documents appearing in global search.")