From 81109d10604567b49d609d85daafdc2d3c702eda Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Wed, 18 Sep 2024 10:53:20 -0300 Subject: [PATCH] Fix flaky test TestFeaturedFacets:test_run (PP-1726) (#2070) * Fix flaky test TestFeaturedFacets:test_run * Update comment --- tests/manager/search/test_external_search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/manager/search/test_external_search.py b/tests/manager/search/test_external_search.py index dd92a637c..0be96664d 100644 --- a/tests/manager/search/test_external_search.py +++ b/tests/manager/search/test_external_search.py @@ -2019,6 +2019,10 @@ def test_run( # whether it has the default quality or no (i.e., missing) quality. # The missing quality case should not cause an exception during search. data.default_quality.quality = default_or_no_quality + # It is unclear why this is necessary, but without it, this test occasionally fails, + # approximately 1 out of 8 times when running in CI. The failure typically occurs on + # the first assertion. + session.expire_all() fixture.populate_search_index() def works(worklist, facets):