Skip to content

Commit ed7c06e

Browse files
authored
ES: fix flaky test (#11640)
I think this broke with #11566, I didn't find anything obvious from their changelog, and doesn't look like something I want to spend more time on debugging...
1 parent 698d618 commit ed7c06e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

readthedocs/search/tests/test_views.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,10 @@ def test_file_search_exact_match(self, client, project):
260260
# There are two results,
261261
# one from each version of the "kuma" project.
262262
assert len(results) == 2
263-
assert results[0]["version"] == {"slug": "latest"}
264-
assert results[1]["version"] == {"slug": "stable"}
263+
# Both versions have the same exact content.
264+
# Order of results is not deterministic anymore for some reason,
265+
# so we use a set to compare the results.
266+
assert {result["version"]["slug"] for result in results} == {"stable", "latest"}
265267
for result in results:
266268
assert result["project"] == {"alias": None, "slug": "kuma"}
267269
assert result["domain"] == "http://kuma.readthedocs.io"

0 commit comments

Comments
 (0)