diff --git a/app/src/androidTest/java/com/owncloud/android/AbstractIT.java b/app/src/androidTest/java/com/owncloud/android/AbstractIT.java index 9549951b3471..68bd9cc9d452 100644 --- a/app/src/androidTest/java/com/owncloud/android/AbstractIT.java +++ b/app/src/androidTest/java/com/owncloud/android/AbstractIT.java @@ -314,7 +314,7 @@ protected Activity getCurrentActivity() { return currentActivity; } - protected void shortSleep() { + protected static void shortSleep() { try { Thread.sleep(2000); } catch (InterruptedException e) { diff --git a/app/src/androidTest/java/com/owncloud/android/AbstractOnServerIT.java b/app/src/androidTest/java/com/owncloud/android/AbstractOnServerIT.java index fd2e206e7f2c..94f54f69615e 100644 --- a/app/src/androidTest/java/com/owncloud/android/AbstractOnServerIT.java +++ b/app/src/androidTest/java/com/owncloud/android/AbstractOnServerIT.java @@ -135,10 +135,20 @@ public static void deleteAllFilesOnServer() { .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); } } }