Эх сурвалжийг харах

On old server we need to wait a bit longer before we can remove a file

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 1 жил өмнө
parent
commit
6b87b2e02c

+ 1 - 1
app/src/androidTest/java/com/owncloud/android/AbstractIT.java

@@ -314,7 +314,7 @@ public abstract class AbstractIT {
         return currentActivity;
     }
 
-    protected void shortSleep() {
+    protected static void shortSleep() {
         try {
             Thread.sleep(2000);
         } catch (InterruptedException e) {

+ 14 - 4
app/src/androidTest/java/com/owncloud/android/AbstractOnServerIT.java

@@ -135,10 +135,20 @@ public abstract class AbstractOnServerIT extends AbstractIT {
                                    .isSuccess());
                 }
 
-                assertTrue(new RemoveFileRemoteOperation(remoteFile.getRemotePath())
-                               .execute(client)
-                               .isSuccess()
-                          );
+                boolean removeResult = false;
+                for (int i = 0; i < 5; i++) {
+                    removeResult = new RemoveFileRemoteOperation(remoteFile.getRemotePath())
+                        .execute(client)
+                        .isSuccess();
+                    
+                    if (removeResult) {
+                        break;
+                    }
+
+                    shortSleep();
+                }
+
+                assertTrue(removeResult);
             }
         }
     }