Merge pull request #8739 from nextcloud/fixDocumentsTest

Fix test for DocumentsStorageProvider
This commit is contained in:
Tobias Kaminsky 2021-07-21 09:36:25 +02:00 committed by GitHub
commit 29d6edc634
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View file

@ -183,7 +183,9 @@ class DocumentsStorageProviderIT : AbstractOnServerIT() {
val file1 = rootDir.createFile("text/plain", RandomString.make())!!
file1.assertRegularFile(size = 0L)
val createdETag = file1.getOCFile(storageManager)!!.etag
val createdETag = file1.getOCFile(storageManager)!!.etagOnServer
assertTrue(createdETag.isNotEmpty())
val content1 = "initial content".toByteArray()
@ -192,8 +194,10 @@ class DocumentsStorageProviderIT : AbstractOnServerIT() {
it!!.write(content1)
}
while (file1.getOCFile(storageManager)!!.etag == createdETag) {
// refresh
while (file1.getOCFile(storageManager)!!.etagOnServer == createdETag) {
shortSleep()
rootDir.listFiles()
}
val remotePath = file1.getOCFile(storageManager)!!.remotePath

View file

@ -718,8 +718,13 @@ public class DocumentsStorageProvider extends DocumentsProvider {
@Override
public final RemoteOperationResult doInBackground(Void... params) {
Log.d(TAG, "run ReloadFolderDocumentTask(), id=" + folder.getDocumentId());
return new RefreshFolderOperation(folder.getFile(), System.currentTimeMillis(), false,
false, true, folder.getStorageManager(), folder.getAccount(),
return new RefreshFolderOperation(folder.getFile(),
System.currentTimeMillis(),
false,
true,
true,
folder.getStorageManager(),
folder.getAccount(),
MainApp.getAppContext())
.execute(folder.getClient());
}