File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
apps/files_external/tests/Storage Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 3333use OC \Files \Notify \RenameChange ;
3434use OCA \Files_External \Lib \Storage \SMB ;
3535use OCP \Files \Notify \IChange ;
36+ use PHPUnit \Framework \ExpectationFailedException ;
3637
3738/**
3839 * Class SmbTest
@@ -96,6 +97,22 @@ public function testStorageId() {
9697 }
9798
9899 public function testNotifyGetChanges () {
100+ $ lastError = null ;
101+ for ($ i = 0 ; $ i < 5 ; $ i ++) {
102+ try {
103+ $ this ->tryTestNotifyGetChanges ();
104+ return ;
105+ } catch (ExpectationFailedException $ e ) {
106+ $ lastError = $ e ;
107+ $ this ->tearDown ();
108+ $ this ->setUp ();
109+ sleep (1 );
110+ }
111+ }
112+ throw $ lastError ;
113+ }
114+
115+ private function tryTestNotifyGetChanges (): void {
99116 $ notifyHandler = $ this ->instance ->notify ('' );
100117 sleep (1 ); //give time for the notify to start
101118 $ this ->instance ->file_put_contents ('/newfile.txt ' , 'test content ' );
You can’t perform that action at this time.
0 commit comments