Skip to content

Commit 0c1c45b

Browse files
authored
Merge pull request #62902 from nextcloud/carl/fix-flaky-test
test(sharing): sort recipients before asserting in testGetShareWithPublicSecret
2 parents 266b2ea + 80046aa commit 0c1c45b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/lib/Sharing/AbstractSharingManagerTests.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,6 +2996,8 @@ public function testGetShareWithPublicSecret(bool $isSecretPublic): void {
29962996
unset($share['last_updated']);
29972997
$this->assertIsList($share['recipients']);
29982998
$this->assertCount(2, $share['recipients']);
2999+
// Sort because database order is not guaranteed
3000+
usort($share['recipients'], fn (array $a, array $b): int => $a['value'] <=> $b['value']);
29993001
$this->assertEquals([
30003002
'class' => TestShareRecipientType1::class,
30013003
'value' => 'recipient1',
@@ -3135,6 +3137,9 @@ public function testGetShareUniqueDisplayNames(): void {
31353137
$this->dbConnection->commit();
31363138

31373139
$share = $this->getShare($accessContext, $id);
3140+
3141+
// Sort because database order is not guaranteed
3142+
usort($share['sources'], fn (array $a, array $b): int => $a['value'] <=> $b['value']);
31383143
usort($share['recipients'], fn (array $a, array $b): int => $a['value'] <=> $b['value']);
31393144
$this->assertEquals([
31403145
[

0 commit comments

Comments
 (0)