|
| 1 | +import uuid |
1 | 2 | from datetime import timedelta |
2 | 3 |
|
3 | 4 | import pytest |
@@ -144,13 +145,14 @@ def sorted_range_query(): |
144 | 145 |
|
145 | 146 | @pytest.fixture |
146 | 147 | def index(sample_data, redis_url, worker_id): |
| 148 | + unique_id = str(uuid.uuid4())[:8] # Use first 8 chars of UUID for brevity |
147 | 149 |
|
148 | 150 | # construct a search index from the schema |
149 | 151 | index = SearchIndex.from_dict( |
150 | 152 | { |
151 | 153 | "index": { |
152 | | - "name": f"user_index_{worker_id}", |
153 | | - "prefix": f"v1_{worker_id}", |
| 154 | + "name": f"user_index_{worker_id}_{unique_id}", |
| 155 | + "prefix": f"v1_{worker_id}_{unique_id}", |
154 | 156 | "storage_type": "hash", |
155 | 157 | }, |
156 | 158 | "fields": [ |
@@ -196,13 +198,14 @@ def hash_preprocess(item: dict) -> dict: |
196 | 198 |
|
197 | 199 | @pytest.fixture |
198 | 200 | def L2_index(sample_data, redis_url, worker_id): |
| 201 | + unique_id = str(uuid.uuid4())[:8] # Use first 8 chars of UUID for brevity |
199 | 202 |
|
200 | 203 | # construct a search index from the schema |
201 | 204 | index = SearchIndex.from_dict( |
202 | 205 | { |
203 | 206 | "index": { |
204 | | - "name": f"L2_index_{worker_id}", |
205 | | - "prefix": f"L2_index_{worker_id}", |
| 207 | + "name": f"L2_index_{worker_id}_{unique_id}", |
| 208 | + "prefix": f"L2_index_{worker_id}_{unique_id}", |
206 | 209 | "storage_type": "hash", |
207 | 210 | }, |
208 | 211 | "fields": [ |
|
0 commit comments