Skip to content

Commit 3ef4d4b

Browse files
authored
ES: fix another flaky test (#11647)
ES: fix another flaky tes Similar to #11640
1 parent 07a4fa6 commit 3ef4d4b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

readthedocs/search/tests/test_faceted_search.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ def test_search_exact_match(self, client, project, case):
2424
results = page_search.execute()
2525

2626
assert len(results) == 2
27-
assert results[0]["project"] == "kuma"
28-
assert results[0]["path"] == "testdocumentation"
29-
assert results[0]["version"] == "latest"
3027

31-
assert results[1]["project"] == "kuma"
32-
assert results[1]["path"] == "testdocumentation"
33-
assert results[1]["version"] == "stable"
28+
# Both versions have the same exact content.
29+
# Order of results is not deterministic anymore for some reason,
30+
# so we use a set to compare the results.
31+
assert {result["version"] for result in results} == {"stable", "latest"}
32+
for result in results:
33+
assert result["project"] == "kuma"
34+
assert result["path"] == "testdocumentation"
3435

3536
def test_search_combined_result(self, client, project):
3637
"""Check search result are combined of both `AND` and `OR` operator

0 commit comments

Comments
 (0)