diff --git a/python_tests/test_index.py b/python_tests/test_index.py index 6899d1c7..9b9a6453 100644 --- a/python_tests/test_index.py +++ b/python_tests/test_index.py @@ -725,10 +725,12 @@ def test_find_in_index_range_issue_1(db0_fixture): def test_insert_1M_keys_to_index(db0_no_autocommit): cut = db0.index() objects = [MemoTestClass(0) for _ in range(25000)] + # generate 1M random unique keys + keys_list = random.sample(range(0, 100_000_000), 1_000_000) start = time.perf_counter() for i in range(1_000_000): # add random int - cut.add(random.randint(0, 100_000_000), objects[i % 25000]) + cut.add(keys_list[i], random.choice(objects)) if i % 10_000 == 0: assert len(cut) == i + 1 result = list(cut.select(0, 1))