Skip to content

Commit

Permalink
unflaky these tests. (#29211)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasobol-msft authored Jun 3, 2022
1 parent 1ab7783 commit 7e263ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import spock.lang.Unroll
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.time.ZoneOffset
import java.time.temporal.ChronoUnit
import java.util.stream.Collectors

class DirectoryAPITests extends APISpec {
Expand Down Expand Up @@ -491,7 +492,7 @@ class DirectoryAPITests extends APISpec {
primaryDirectoryClient.setProperties(new FileSmbProperties().setFileChangeTime(changeTime), null)

then:
primaryDirectoryClient.getProperties().getSmbProperties().getFileChangeTime() == changeTime
primaryDirectoryClient.getProperties().getSmbProperties().getFileChangeTime().truncatedTo(ChronoUnit.MICROS) == changeTime.truncatedTo(ChronoUnit.MICROS)
}

@Unroll
Expand Down Expand Up @@ -959,7 +960,7 @@ class DirectoryAPITests extends APISpec {
destProperties.getSmbProperties().getNtfsFileAttributes() == EnumSet.of(NtfsFileAttributes.DIRECTORY)
destProperties.getSmbProperties().getFileCreationTime()
destProperties.getSmbProperties().getFileLastWriteTime()
destProperties.getSmbProperties().getFileChangeTime() == fileChangeTime
destProperties.getSmbProperties().getFileChangeTime().truncatedTo(ChronoUnit.MICROS) == fileChangeTime.truncatedTo(ChronoUnit.MICROS)
}

@RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "V2021_04_10")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import java.nio.file.NoSuchFileException
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.time.ZoneOffset
import java.time.temporal.ChronoUnit

import static com.azure.storage.file.share.FileTestHelper.assertExceptionStatusCodeAndMessage
import static com.azure.storage.file.share.FileTestHelper.assertResponseStatusCode
Expand Down Expand Up @@ -1203,7 +1204,7 @@ class FileAPITests extends APISpec {
primaryFileClient.setProperties(512, null, new FileSmbProperties().setFileChangeTime(changeTime), null)

then:
primaryFileClient.getProperties().getSmbProperties().getFileChangeTime() == changeTime
primaryFileClient.getProperties().getSmbProperties().getFileChangeTime().truncatedTo(ChronoUnit.MICROS) == changeTime.truncatedTo(ChronoUnit.MICROS)
}

def "Set httpHeaders error"() {
Expand Down Expand Up @@ -1674,7 +1675,7 @@ class FileAPITests extends APISpec {
destProperties.getSmbProperties().getNtfsFileAttributes() == EnumSet.of(NtfsFileAttributes.ARCHIVE, NtfsFileAttributes.READ_ONLY)
destProperties.getSmbProperties().getFileCreationTime()
destProperties.getSmbProperties().getFileLastWriteTime()
destProperties.getSmbProperties().getFileChangeTime() == fileChangeTime
destProperties.getSmbProperties().getFileChangeTime().truncatedTo(ChronoUnit.MICROS) == fileChangeTime.truncatedTo(ChronoUnit.MICROS)
}

@RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "V2021_04_10")
Expand Down

0 comments on commit 7e263ad

Please sign in to comment.