Skip to content

Commit 8b16447

Browse files
committed
Added timeouts for index creation
1 parent c9f10f3 commit 8b16447

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/test_asyncio/test_command_policies.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import random
23

34
import pytest
@@ -114,6 +115,9 @@ async def wrapper(*args, request_policy: RequestPolicy, **kwargs):
114115
)
115116
assert determined_nodes[0] == primary_nodes[0]
116117

118+
# Wait for index creation
119+
await asyncio.sleep(1)
120+
117121
# Routed to another random primary node
118122
info = await r.ft().info()
119123
assert info["index_name"] == "idx"

tests/test_command_policies.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import random
2+
from time import sleep
23
from unittest.mock import Mock, patch
34

45
import pytest
@@ -11,6 +12,7 @@
1112
from redis.commands.search.aggregation import AggregateRequest
1213
from redis.commands.search.field import TextField, NumericField
1314
from tests.conftest import skip_if_server_version_lt
15+
from tests.test_search import waitForIndex
1416

1517

1618
@pytest.mark.onlycluster
@@ -115,6 +117,9 @@ def wrapper(*args, request_policy: RequestPolicy, **kwargs):
115117
)
116118
assert determined_nodes[0] == primary_nodes[0]
117119

120+
# Wait for index creation
121+
sleep(1)
122+
118123
# Routed to another random primary node
119124
info = r.ft().info()
120125
assert info["index_name"] == "idx"

0 commit comments

Comments
 (0)