Skip to content

Commit

Permalink
Increased expiry time to prevent service errors (Azure#30391)
Browse files Browse the repository at this point in the history
* Increased expiry time to prevent service errors

* Updated recordings

* Added 30 sleep to copy test
  • Loading branch information
rickle-msft authored Aug 11, 2022
1 parent fa3a7e6 commit e517581
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {

def "set immutability policy min"() {
setup:
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand All @@ -192,7 +192,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
@Unroll
def "set immutability policy"() {
setup:
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(policyMode)
Expand Down Expand Up @@ -236,7 +236,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
setup:
def bac = new BlobRequestConditions()
.setIfUnmodifiedSince(unmodified)
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand All @@ -257,7 +257,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
setup:
def bac = new BlobRequestConditions()
.setIfUnmodifiedSince(oldDate)
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand All @@ -279,7 +279,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
.setIfMatch(ifMatch)
.setIfNoneMatch(ifNoneMatch)
.setIfModifiedSince(ifModifiedSince)
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand All @@ -304,7 +304,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "set immutability policy error"() {
setup:
def blob = vlwContainer.getBlobClient(generateBlobName())
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand All @@ -319,7 +319,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {

def "set immutability policy IA"() {
setup:
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.MUTABLE)
Expand All @@ -334,7 +334,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {

def "delete immutability policy min"() {
setup:
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand All @@ -351,7 +351,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {

def "delete immutability policy"() {
setup:
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
Expand Down Expand Up @@ -453,7 +453,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "append blob create"() {
setup:
def appendBlob = vlwContainer.getBlobClient(generateBlobName()).getAppendBlobClient()
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand All @@ -475,7 +475,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "page blob create"() {
setup:
def pageBlob = vlwContainer.getBlobClient(generateBlobName()).getPageBlobClient()
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand All @@ -497,7 +497,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "block blob commit block list"() {
setup:
def blockBlob = vlwBlob.getBlockBlobClient()
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand All @@ -519,7 +519,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "block blob upload"() {
setup:
def blockBlob = vlwBlob.getBlockBlobClient()
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand All @@ -542,7 +542,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
@LiveOnly
def "blob upload"() {
setup:
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand Down Expand Up @@ -570,8 +570,9 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "sync copy"() {
setup:
vlwContainer.setAccessPolicy(PublicAccessType.CONTAINER, null)
sleepIfRecord(30000) // Give time for the policy to take effect
def destination = vlwContainer.getBlobClient(generateBlobName()).getBlockBlobClient()
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand All @@ -596,7 +597,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def "copy"() {
setup:
def destination = vlwContainer.getBlobClient(generateBlobName()).getBlockBlobClient()
def expiryTime = getNamer().getUtcNow().plusSeconds(2)
def expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand Down Expand Up @@ -624,7 +625,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def service = new AccountSasService().setBlobAccess(true)
def resource = new AccountSasResourceType().setObject(true).setContainer(true)
def sasValues = new AccountSasSignatureValues(expiryTime, permissions, service, resource)
expiryTime = getNamer().getUtcNow().plusSeconds(2)
expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand Down Expand Up @@ -652,7 +653,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def expiryTime = namer.getUtcNow().plusDays(1)
def permissions = BlobContainerSasPermission.parse("racwdxltmei")
def sasValues = new BlobServiceSasSignatureValues(expiryTime, permissions)
expiryTime = getNamer().getUtcNow().plusSeconds(2)
expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand Down Expand Up @@ -680,7 +681,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def expiryTime = namer.getUtcNow().plusDays(1)
def permissions = BlobSasPermission.parse("racwdxtlmei")
def sasValues = new BlobServiceSasSignatureValues(expiryTime, permissions)
expiryTime = getNamer().getUtcNow().plusSeconds(2)
expiryTime = getNamer().getUtcNow().plusDays(2)
// The service rounds Immutability Policy Expiry to the nearest second.
def expectedImmutabilityPolicyExpiry = expiryTime.truncatedTo(ChronoUnit.SECONDS)
def immutabilityPolicy = new BlobImmutabilityPolicy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"x-ms-immutability-policy-mode" : "unlocked",
"x-ms-version" : "2021-02-12",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Thu, 14 Oct 2021 15:46:54 GMT",
"x-ms-immutability-policy-until-date" : "Sat, 16 Oct 2021 15:46:52 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "32ad1314-b01e-000e-5712-c1f372000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"x-ms-version" : "2020-10-02",
"x-ms-lease-status" : "unlocked",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"x-ms-lease-state" : "available",
"x-ms-blob-committed-block-count" : "0",
"Last-Modified" : "Wed, 11 Aug 2021 17:11:28 GMT",
Expand All @@ -105,4 +105,4 @@
"Exception" : null
} ],
"variables" : [ "3acd3d2703acd3d2723e17814fcfa1098b7374de7885", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "3acd3d2713acd3d2723e67949242ca4eb485f4544b0b", "3acd3d2723acd3d2723e691062d7606a786d94b55b7f", "2021-08-11T17:11:28.709771800Z" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"x-ms-immutability-policy-mode" : "unlocked",
"x-ms-version" : "2021-02-12",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Thu, 14 Oct 2021 15:46:53 GMT",
"x-ms-immutability-policy-until-date" : "Sat, 16 Oct 2021 15:46:51 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "39a6bc87-101e-0007-6612-c1b6a1000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"x-ms-version" : "2020-10-02",
"x-ms-lease-status" : "unlocked",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"x-ms-lease-state" : "available",
"Last-Modified" : "Wed, 11 Aug 2021 17:11:28 GMT",
"x-ms-version-id" : "2021-08-11T17:11:28.8713467Z",
Expand All @@ -108,4 +108,4 @@
"Exception" : null
} ],
"variables" : [ "0d73644400d73644462887264bc0c9b43675747e7b9a", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "0d73644410d73644462855765b6af79bd3f59481d8f5", "2021-08-11T17:11:28.703770100Z" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"x-ms-request-id" : "cd4bcf51-e01e-0004-5dd3-8ef2b5000000",
"Content-Type" : "application/octet-stream",
"x-ms-version" : "2020-10-02",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"x-ms-legal-hold" : "true",
"Date" : "Wed, 11 Aug 2021 17:11:28 GMT",
"Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==",
Expand All @@ -110,4 +110,4 @@
"Exception" : null
} ],
"variables" : [ "9f11288f09f11288f7ea73693cf1777fbff114fdfb52", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "9f11288f19f11288f7ea64753395c17ae4b0841cd84a", "2021-08-11T17:11:28.703770100Z" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"x-ms-immutability-policy-mode" : "unlocked",
"x-ms-version" : "2021-02-12",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Thu, 14 Oct 2021 15:46:54 GMT",
"x-ms-immutability-policy-until-date" : "Sat, 16 Oct 2021 15:46:52 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "17adebe9-401e-0047-3e12-c1b199000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"Content-Type" : "application/octet-stream",
"x-ms-version" : "2020-10-02",
"x-ms-copy-id" : "8148066f-448c-4b73-ba46-8c7a31b88059",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"x-ms-copy-source" : "https://kasoboljavaversioned.blob.core.windows.net/1dcc3e4b-d08c-4202-9222-7f022dfc5c57/d59f871e1d59f871e15749826bc3aafc615a04d6395a",
"x-ms-copy-progress" : "0/0",
"x-ms-legal-hold" : "true",
Expand Down Expand Up @@ -139,7 +139,7 @@
"Content-Type" : "application/octet-stream",
"x-ms-version" : "2020-10-02",
"x-ms-copy-id" : "8148066f-448c-4b73-ba46-8c7a31b88059",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"x-ms-copy-source" : "https://kasoboljavaversioned.blob.core.windows.net/1dcc3e4b-d08c-4202-9222-7f022dfc5c57/d59f871e1d59f871e15749826bc3aafc615a04d6395a",
"x-ms-copy-progress" : "0/0",
"x-ms-legal-hold" : "true",
Expand All @@ -154,4 +154,4 @@
"Exception" : null
} ],
"variables" : [ "d59f871e0d59f871e15743887bb090d8c39f24063ad4", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "d59f871e1d59f871e15749826bc3aafc615a04d6395a", "d59f871e2d59f871e157514435c172f64ce0f483ebd7", "2021-08-11T17:11:28.726770400Z" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"x-ms-immutability-policy-mode" : "unlocked",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "bf767822-801e-0070-17d3-8ec645000000",
Expand Down Expand Up @@ -121,4 +121,4 @@
"Exception" : null
} ],
"variables" : [ "ff00eec20ff00eec272b883100317aad3ed864793961", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "ff00eec21ff00eec272b0604032ae48eb6a3449bc99e", "2021-08-11T17:11:28.700769600Z" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"x-ms-version" : "2020-10-02",
"x-ms-lease-status" : "unlocked",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"x-ms-lease-state" : "available",
"x-ms-blob-sequence-number" : "0",
"Last-Modified" : "Wed, 11 Aug 2021 17:11:28 GMT",
Expand All @@ -105,4 +105,4 @@
"Exception" : null
} ],
"variables" : [ "e79977f40e79977f408f8581710d489a629ba45da8c7", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "e79977f41e79977f408f896225f45324c6d7d4e24b51", "e79977f42e79977f408f509865c431ef142d24df18a8", "2021-08-11T17:11:28.733770800Z" ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"x-ms-immutability-policy-mode" : "unlocked",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-immutability-policy-until-date" : "Wed, 11 Aug 2021 17:11:30 GMT",
"x-ms-immutability-policy-until-date" : "Fri, 13 Aug 2021 17:11:28 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "4f06fd93-701e-0016-0dd3-8e8965000000",
Expand All @@ -69,4 +69,4 @@
"Exception" : null
} ],
"variables" : [ "35fa8f77035fa8f77492964802acb726c4a474c02b32", "1dcc3e4b-d08c-4202-9222-7f022dfc5c57", "35fa8f77135fa8f77492992770e7598fd36a74c5c8c3", "2021-08-11T17:11:28.705771Z" ]
}
}
Loading

0 comments on commit e517581

Please sign in to comment.