aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-05-01 16:57:21 +0200
committerJosh <josh.t.richards@gmail.com>2024-05-10 09:59:39 -0400
commit623023c8e5a990edb6675f54c82cc129edf4a492 (patch)
tree9545967170f0f592970a47043a7a45720496bc70 /apps/files_external
parentefb03b726d27907f161a0c011a6ebc3cc3bfcd2b (diff)
downloadnextcloud-server-623023c8e5a990edb6675f54c82cc129edf4a492.tar.gz
nextcloud-server-623023c8e5a990edb6675f54c82cc129edf4a492.zip
test: retry smb notify test a few times
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/tests/Storage/SmbTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php
index 30040e499c8..d700f676b75 100644
--- a/apps/files_external/tests/Storage/SmbTest.php
+++ b/apps/files_external/tests/Storage/SmbTest.php
@@ -33,6 +33,7 @@ use OC\Files\Notify\Change;
use OC\Files\Notify\RenameChange;
use OCA\Files_External\Lib\Storage\SMB;
use OCP\Files\Notify\IChange;
+use PHPUnit\Framework\ExpectationFailedException;
/**
* Class SmbTest
@@ -96,6 +97,22 @@ class SmbTest extends \Test\Files\Storage\Storage {
}
public function testNotifyGetChanges() {
+ $lastError = null;
+ for($i = 0; $i < 5; $i++) {
+ try {
+ $this->tryTestNotifyGetChanges();
+ return;
+ } catch (ExpectationFailedException $e) {
+ $lastError = $e;
+ $this->tearDown();
+ $this->setUp();
+ sleep(1);
+ }
+ }
+ throw $lastError;
+ }
+
+ private function tryTestNotifyGetChanges(): void {
$notifyHandler = $this->instance->notify('');
sleep(1); //give time for the notify to start
$this->instance->file_put_contents('/newfile.txt', 'test content');