Skip to content

Commit dc34981

Browse files
committed
Cancel paused upload instead of waiting to complete
1 parent b95f36c commit dc34981

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

aws-storage-s3/src/androidTest/java/com/amplifyframework/storage/s3/StorageCanaryTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class StorageCanaryTest {
9696
val fileName = "ExampleKey${UUID.randomUUID()}"
9797

9898
val opFuture = CompletableFuture<StorageUploadFileOperation<*>>()
99-
val uploadComplete = CompletableFuture<Boolean>()
10099
val paused = CompletableFuture<Boolean>()
101100

102101
val op = Amplify.Storage.uploadFile(
@@ -111,11 +110,9 @@ class StorageCanaryTest {
111110
paused.complete(true)
112111
},
113112
{
114-
uploadComplete.complete(true)
115113
},
116114
{
117115
paused.completeExceptionally(it)
118-
uploadComplete.complete(false)
119116
}
120117
)
121118
opFuture.complete(op)
@@ -124,9 +121,7 @@ class StorageCanaryTest {
124121
val operation = syncStorage.getTransfer(op.transferId)
125122
Log.i(TAG, "Current State" + operation.transferState)
126123

127-
// Ensure the transfer finishes. We don't particularly care if it's successful or not at this point.
128-
// We just don't want it still going to potentially impact other tests.
129-
uploadComplete.get(TIMEOUT_S, TimeUnit.SECONDS)
124+
op.cancel()
130125
}
131126

132127
@Test

0 commit comments

Comments
 (0)