Skip to content

Commit 20d8540

Browse files
committed
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 <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5ffde03 commit 20d8540

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,17 @@ public function testGetListOfIdsByDn(): void {
283283
[$mapper,] = $this->initTest();
284284

285285
$listOfDNs = [];
286+
// List size exceeds the implementation's 65000-parameter chunk limit, forcing multiple chunked queries
286287
for ($i = 0; $i < 66640; $i++) {
287-
// Postgres has a limit of 65535 values in a single IN list
288288
$name = 'as_' . $i;
289289
$dn = 'uid=' . $name . ',dc=example,dc=org';
290290
$listOfDNs[] = $dn;
291-
if ($i % 20 === 0) {
291+
if ($i % 5000 === 0) {
292292
$mapper->map($dn, $name, 'fake-uuid-' . $i);
293293
}
294294
}
295295

296296
$result = $mapper->getListOfIdsByDn($listOfDNs);
297-
$this->assertCount(66640 / 20, $result);
297+
$this->assertCount(14, $result);
298298
}
299299
}

0 commit comments

Comments
 (0)