Explorar o código

Wait up to 10 seconds for incoming changes from SMB notifier

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Morris Jobke %!s(int64=5) %!d(string=hai) anos
pai
achega
6ff4371348
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      apps/files_external/tests/Storage/SmbTest.php

+ 8 - 1
apps/files_external/tests/Storage/SmbTest.php

@@ -102,7 +102,14 @@ class SmbTest extends \Test\Files\Storage\Storage {
 		$this->instance->unlink('/renamed.txt');
 		sleep(1); //time for all changes to be processed
 
-		$changes = $notifyHandler->getChanges();
+		$changes = [];
+		$count = 0;
+		// wait up to 10 seconds for incoming changes
+		while (count($changes) < 3 && $count < 10) {
+			$changes = array_merge($changes, $notifyHandler->getChanges());
+			$count++;
+			sleep(1);
+		}
 		$notifyHandler->stop();
 
 		$expected = [