From 6b87b2e02c53d05cabd17b04c728de8299ace8ce Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 16 Oct 2023 11:29:03 +0200 Subject: [PATCH] On old server we need to wait a bit longer before we can remove a file Signed-off-by: tobiasKaminsky --- .../java/com/owncloud/android/AbstractIT.java | 2 +- .../owncloud/android/AbstractOnServerIT.java | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) 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); } } }