Skip to content

Commit 7fac683

Browse files
Merge pull request #60895 from nextcloud/backport/60756/stable34
[stable34] test(user_ldap): speed up AbstractMappingTestCase chunking test
2 parents f31a245 + dbb82b0 commit 7fac683

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)