mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
test: retry smb notify test a few times
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
d82fb01b0a
commit
13fe1e26ca
1 changed files with 17 additions and 0 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue