Skip to content

Commit e12304e

Browse files
committed
vset test causes crashes of the test servers in pipeline - changing the problematic tests to use less data(sync and async tests)
1 parent 12b153e commit e12304e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tests/test_asyncio/test_vsets.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,23 +451,23 @@ async def test_vsim_with_filter(d_client):
451451

452452
@skip_if_server_version_lt("7.9.0")
453453
async def test_vsim_truth_no_thread_enabled(d_client):
454-
elements_count = 5000
454+
elements_count = 1000
455455
vector_dim = 50
456456
for i in range(1, elements_count + 1):
457-
float_array = [i for _ in range(vector_dim)]
457+
float_array = [i * vector_dim for _ in range(vector_dim)]
458458
await d_client.vset().vadd("myset", float_array, f"elem_{i}")
459459

460460
await d_client.vset().vadd("myset", [-22 for _ in range(vector_dim)], "elem_man_2")
461461

462462
sim_without_truth = await d_client.vset().vsim(
463-
"myset", input="elem_man_2", with_scores=True
463+
"myset", input="elem_man_2", count=30, with_scores=True
464464
)
465465
sim_truth = await d_client.vset().vsim(
466-
"myset", input="elem_man_2", with_scores=True, truth=True
466+
"myset", input="elem_man_2", count=30, with_scores=True, truth=True
467467
)
468468

469-
assert len(sim_without_truth) == 10
470-
assert len(sim_truth) == 10
469+
assert len(sim_without_truth) == 30
470+
assert len(sim_truth) == 30
471471

472472
assert isinstance(sim_without_truth, dict)
473473
assert isinstance(sim_truth, dict)

tests/test_vsets.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,23 +453,23 @@ def test_vsim_with_filter(d_client):
453453

454454
@skip_if_server_version_lt("7.9.0")
455455
def test_vsim_truth_no_thread_enabled(d_client):
456-
elements_count = 5000
456+
elements_count = 1000
457457
vector_dim = 50
458458
for i in range(1, elements_count + 1):
459-
float_array = [i for _ in range(vector_dim)]
459+
float_array = [i * vector_dim for _ in range(vector_dim)]
460460
d_client.vset().vadd("myset", float_array, f"elem_{i}")
461461

462462
d_client.vset().vadd("myset", [-22 for _ in range(vector_dim)], "elem_man_2")
463463

464464
sim_without_truth = d_client.vset().vsim(
465-
"myset", input="elem_man_2", with_scores=True
465+
"myset", input="elem_man_2", with_scores=True, count=30
466466
)
467467
sim_truth = d_client.vset().vsim(
468-
"myset", input="elem_man_2", with_scores=True, truth=True
468+
"myset", input="elem_man_2", with_scores=True, count=30, truth=True
469469
)
470470

471-
assert len(sim_without_truth) == 10
472-
assert len(sim_truth) == 10
471+
assert len(sim_without_truth) == 30
472+
assert len(sim_truth) == 30
473473

474474
assert isinstance(sim_without_truth, dict)
475475
assert isinstance(sim_truth, dict)

0 commit comments

Comments
 (0)