diff options
author | Ariel Shtul <ariel.shtul@redislabs.com> | 2021-11-10 15:10:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 15:10:19 +0200 |
commit | 776dd5938a511052d5ce586dce66ac3508fc2e0e (patch) | |
tree | 90f917cce50da5c812d80faeb36582ce0aa4a4ac | |
parent | e07bd9464d6ce226e3db9a5eaf95bc2ecfe8e034 (diff) | |
download | redis-py-776dd5938a511052d5ce586dce66ac3508fc2e0e.tar.gz |
[TEST] search alias test (#1695)
-rw-r--r-- | tests/test_search.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/tests/test_search.py b/tests/test_search.py index 4175c53..e07a61c 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -646,25 +646,15 @@ def test_alias(): index1.hset("index1:lonestar", mapping={"name": "lonestar"}) index2.hset("index2:yogurt", mapping={"name": "yogurt"}) - if os.environ.get("GITHUB_WORKFLOW", None) is not None: - time.sleep(2) - else: - time.sleep(5) - - def1 = IndexDefinition(prefix=["index1:"], score_field="name") - def2 = IndexDefinition(prefix=["index2:"], score_field="name") + def1 = IndexDefinition(prefix=["index1:"]) + def2 = IndexDefinition(prefix=["index2:"]) ftindex1 = index1.ft("testAlias") - ftindex2 = index1.ft("testAlias2") + ftindex2 = index2.ft("testAlias2") ftindex1.create_index((TextField("name"),), definition=def1) ftindex2.create_index((TextField("name"),), definition=def2) - # CI is slower - try: - res = ftindex1.search("*").docs[0] - except IndexError: - time.sleep(5) - res = ftindex1.search("*").docs[0] + res = ftindex1.search("*").docs[0] assert "index1:lonestar" == res.id # create alias and check for results @@ -681,9 +671,6 @@ def test_alias(): ftindex2.aliasupdate("spaceballs") alias_client2 = getClient().ft("spaceballs") - if os.environ.get("GITHUB_WORKFLOW", None) is not None: - time.sleep(5) - res = alias_client2.search("*").docs[0] assert "index2:yogurt" == res.id |