Skip to content

Commit

Permalink
[Storage] Unflaky more RBAC dependent tests (Azure#24261)
Browse files Browse the repository at this point in the history
* transform composite blob exception to datalake model.

* cl.

* ...

* retry tests that rely on RBAC replication.
  • Loading branch information
kasobol-msft authored Sep 22, 2021
1 parent 4c97694 commit 0424300
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.azure.storage.blob

import com.azure.core.http.HttpAuthorization
import com.azure.core.test.TestMode
import com.azure.core.util.BinaryData
import com.azure.core.util.Context
import com.azure.storage.blob.models.BlobStorageException
Expand All @@ -13,6 +14,7 @@ import com.azure.storage.blob.specialized.AppendBlobClient
import com.azure.storage.blob.specialized.BlockBlobClient
import com.azure.storage.blob.specialized.PageBlobClient
import com.azure.storage.common.test.shared.extensions.RequiredServiceVersion
import spock.lang.Retry

@RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02")
class OAuthCopySourceTests extends APISpec {
Expand All @@ -38,6 +40,8 @@ class OAuthCopySourceTests extends APISpec {
pageBlobClient.create(PageBlobClient.PAGE_BYTES)
}

// RBAC replication lag
@Retry(count = 5, delay = 30, condition = { env.testMode == TestMode.LIVE })
def "Append blob append block from URL source oauth"() {
setup:
def sourceBlob = cc.getBlobClient(generateBlobName())
Expand Down Expand Up @@ -70,6 +74,8 @@ class OAuthCopySourceTests extends APISpec {
thrown(BlobStorageException)
}

// RBAC replication lag
@Retry(count = 5, delay = 30, condition = { env.testMode == TestMode.LIVE })
def "Block blob upload from URL source oauth"() {
setup:
def oauthHeader = getAuthToken()
Expand Down Expand Up @@ -100,6 +106,8 @@ class OAuthCopySourceTests extends APISpec {
thrown(BlobStorageException)
}

// RBAC replication lag
@Retry(count = 5, delay = 30, condition = { env.testMode == TestMode.LIVE })
def "Block blob stage block from URL source oauth"() {
setup:
def oauthHeader = getAuthToken()
Expand Down Expand Up @@ -133,6 +141,8 @@ class OAuthCopySourceTests extends APISpec {
thrown(BlobStorageException)
}

// RBAC replication lag
@Retry(count = 5, delay = 30, condition = { env.testMode == TestMode.LIVE })
def "Upload pages from URL source oauth"() {
setup:
def pageRange = new PageRange().setStart(0).setEnd(PageBlobClient.PAGE_BYTES - 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.azure.storage.file.share

import com.azure.core.http.HttpAuthorization
import com.azure.core.test.TestMode
import com.azure.core.util.Context
import com.azure.storage.blob.BlobClient
import com.azure.storage.blob.BlobContainerClient
import com.azure.storage.blob.BlobServiceClientBuilder
import com.azure.storage.common.test.shared.extensions.RequiredServiceVersion
import com.azure.storage.file.share.models.ShareStorageException
import com.azure.storage.file.share.options.ShareFileUploadRangeFromUrlOptions
import spock.lang.Retry

@RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "V2020_10_02")
class OAuthCopySourceTests extends APISpec {
Expand Down Expand Up @@ -43,6 +45,8 @@ class OAuthCopySourceTests extends APISpec {
.createBlobContainer(getShareName())
}

// RBAC replication lag
@Retry(count = 5, delay = 30, condition = { env.testMode == TestMode.LIVE })
def "Copy from URL with oauth source"() {
given:
def oauthHeader = getAuthToken()
Expand Down

0 comments on commit 0424300

Please sign in to comment.