From ab29028da775015993533c24db3ad21023b82a5e Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 12 Mar 2019 17:16:03 +0100 Subject: [PATCH] Wait up to 10 seconds for incoming changes from SMB notifier Signed-off-by: Morris Jobke --- apps/files_external/tests/Storage/SmbTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php index e3c0408114..562ac6c8e5 100644 --- a/apps/files_external/tests/Storage/SmbTest.php +++ b/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 = [