From dbb82b0bc27bbb092ee96215d96daba08d51915e Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Wed, 27 May 2026 16:07:21 +0200 Subject: [PATCH] test(user_ldap): speed up AbstractMappingTestCase chunking test Reduce mapped entries from 3332 to 14 (every 5000th instead of every 20th) so the test exercises the chunking path without inserting thousands of rows. Move the explanatory comment above the loop where it belongs. Note: the implementation chunks at its own 65000 total-parameter limit (not Postgres's 65535 IN-list limit), so the comment uses 65000. Signed-off-by: Anna Larch AI-Assisted-By: Claude Sonnet 4.6 --- apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php b/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php index 8a0ec8a0f9eff..8188e39cd84f7 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php @@ -283,17 +283,17 @@ public function testGetListOfIdsByDn(): void { [$mapper,] = $this->initTest(); $listOfDNs = []; + // List size exceeds the implementation's 65000-parameter chunk limit, forcing multiple chunked queries for ($i = 0; $i < 66640; $i++) { - // Postgres has a limit of 65535 values in a single IN list $name = 'as_' . $i; $dn = 'uid=' . $name . ',dc=example,dc=org'; $listOfDNs[] = $dn; - if ($i % 20 === 0) { + if ($i % 5000 === 0) { $mapper->map($dn, $name, 'fake-uuid-' . $i); } } $result = $mapper->getListOfIdsByDn($listOfDNs); - $this->assertCount(66640 / 20, $result); + $this->assertCount(14, $result); } }