Skip to content

Storage - Fix Flaky Stress Tests#48359

Merged
browndav-msft merged 25 commits into
Azure:mainfrom
browndav-msft:fix-flaky-tests
Mar 16, 2026
Merged

Storage - Fix Flaky Stress Tests#48359
browndav-msft merged 25 commits into
Azure:mainfrom
browndav-msft:fix-flaky-tests

Conversation

@browndav-msft

Copy link
Copy Markdown
Member

This is a fix to fix the issues we've been having with the stress tests.

- read functions had FAIL_FAST which would throw an error when  the stream had reached then end and we wanted to read from the stream again. So we removed from  both reads.
- refactor code so that the exit criteria is a tthe beginning
- refactor the emitContentInfo for dry
- changed emitValue to tryEmitValue
- remove Sinks.EmitFailureHandler.FAIL_FAST so that multiple closes does not cause an error to be thrown
- opentelemetry-runtime-telemetry-java8 from 2.24.0-alpha -> 2.15.0-alpha
- opentelemetry-logback-appender-1.0 from 2.24.0-alpha -> 2.15.0-alpha
@github-actions github-actions Bot added Azure.Core azure-core Storage Storage Service (Queues, Blobs, Files) labels Mar 10, 2026
@ibrandes
ibrandes marked this pull request as ready for review March 10, 2026 23:35
Copilot AI review requested due to automatic review settings March 10, 2026 23:35
@ibrandes ibrandes changed the title Fix flaky tests Storage - Fix Flaky Stress Tests Mar 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce flakiness in Storage stress tests by making cleanup more resilient, making CRC telemetry streams tolerate re-subscription/double-close behaviors, and aligning dependencies with the chosen OpenTelemetry runtime metrics version.

Changes:

  • Replace unconditional deletes with deleteIfExists() across multiple stress scenarios to avoid cleanup failures when resources are already gone.
  • Add retry/timeout-based global cleanup logic in scenario base classes and add retry logic to async runs.
  • Adjust CRC stream emission behavior to avoid failures on repeated terminal events; downgrade OpenTelemetry instrumentation dependencies to 2.15.0-alpha.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
sdk/storage/azure-storage-stress/src/main/java/com/azure/storage/stress/TelemetryHelper.java Adjust JVM runtime metrics registration and make timeout/cancellation detection null-safe.
sdk/storage/azure-storage-stress/src/main/java/com/azure/storage/stress/CrcOutputStream.java Switch sink emission to tryEmitValue to tolerate double-close.
sdk/storage/azure-storage-stress/src/main/java/com/azure/storage/stress/CrcInputStream.java Refactor EOF emission, add resubscription state reset, and switch to tryEmitValue.
sdk/storage/azure-storage-stress/pom.xml Downgrade OTel runtime telemetry + logback appender to 2.15.0-alpha.
sdk/storage/azure-storage-file-share-stress/src/main/java/com/azure/storage/file/share/stress/UploadFromFile.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-file-share-stress/src/main/java/com/azure/storage/file/share/stress/ShareScenarioBase.java Add retrying global cleanup + async retry behavior and new logging.
sdk/storage/azure-storage-file-share-stress/pom.xml Downgrade OTel runtime telemetry + logback appender to 2.15.0-alpha.
sdk/storage/azure-storage-file-datalake-stress/src/main/java/com/azure/storage/file/datalake/stress/UploadFromFile.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-file-datalake-stress/src/main/java/com/azure/storage/file/datalake/stress/Upload.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-file-datalake-stress/src/main/java/com/azure/storage/file/datalake/stress/DataLakeScenarioBase.java Add retrying global cleanup + async retry behavior and new logging.
sdk/storage/azure-storage-file-datalake-stress/pom.xml Downgrade OTel runtime telemetry + logback appender to 2.15.0-alpha.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/UploadPages.java Use deleteIfExists() and swallow delete errors during cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/Upload.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/StageBlock.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/PageBlobScenarioBase.java Add retrying global cleanup + async retry behavior and new logging.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/PageBlobOutputStream.java Use deleteIfExists() and swallow delete errors during cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/CommitBlockList.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/BlockBlobUpload.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/BlockBlobOutputStream.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/BlobScenarioBase.java Add retrying global cleanup + async retry behavior and structured logging.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/AppendBlock.java Use deleteIfExists() and swallow delete errors during cleanup.
sdk/storage/azure-storage-blob-stress/src/main/java/com/azure/storage/blob/stress/AppendBlobOutputStream.java Use deleteIfExists() during per-test cleanup.
sdk/storage/azure-storage-blob-stress/pom.xml Downgrade OTel runtime telemetry + logback appender to 2.15.0-alpha.
sdk/parents/azure-client-sdk-parent/pom.xml Downgrade io.clientcore:linting-extensions used by checkstyle plugin from beta.2 to beta.1.

Comment thread sdk/storage/azure-storage-file-datalake-stress/pom.xml
Comment thread sdk/storage/azure-storage-stress/pom.xml
Comment thread sdk/storage/azure-storage-file-share-stress/pom.xml
@browndav-msft
browndav-msft requested a review from ibrandes March 11, 2026 17:04

@ibrandes ibrandes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i resolved all comments that i don't think need to be addressed right now, but there are still a couple lingering ones (make sure you expand hidden conversations). not sure how important the ones about globalCleanupAsync are, but i think we should address the ones about doOnError and deleteAllFilesInFileSystem, thoughts?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.

Comment thread sdk/storage/azure-storage-stress/pom.xml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.

Comment thread sdk/storage/azure-storage-file-datalake-stress/pom.xml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 8 comments.

Comment thread sdk/storage/azure-storage-stress/pom.xml
Comment thread sdk/storage/azure-storage-blob-stress/pom.xml
Comment thread sdk/storage/azure-storage-file-share-stress/pom.xml
Comment thread sdk/storage/azure-storage-file-datalake-stress/pom.xml

@ibrandes ibrandes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@browndav-msft
browndav-msft enabled auto-merge (squash) March 16, 2026 22:35
@browndav-msft
browndav-msft merged commit 3544379 into Azure:main Mar 16, 2026
12 checks passed
@browndav-msft
browndav-msft deleted the fix-flaky-tests branch March 16, 2026 22:37
@weidongxu-microsoft

weidongxu-microsoft commented Mar 17, 2026

Copy link
Copy Markdown
Member

@browndav-msft Please update
https://github.com/Azure/azure-sdk-for-java/blob/main/eng/versioning/external_dependencies.txt#L126

Otherwise any increment PR would revert this version change. e.g. #48434

browndav-msft added a commit to browndav-msft/azure-sdk-for-java that referenced this pull request Mar 17, 2026
* removed enableDeterministic

* change .delete() to .deleteIfExists()

* remove Sinks.EmitFailureHandler.FAIL_FAST from CrcInputStream

- read functions had FAIL_FAST which would throw an error when  the stream had reached then end and we wanted to read from the stream again. So we removed from  both reads.
- refactor code so that the exit criteria is a tthe beginning
- refactor the emitContentInfo for dry

* prevent crashes on reattempted close on stream

- changed emitValue to tryEmitValue
- remove Sinks.EmitFailureHandler.FAIL_FAST so that multiple closes does not cause an error to be thrown

* fix telemetry so that it doesnt swallow errors

* roll back two deps because they were causing failures in the containers

- opentelemetry-runtime-telemetry-java8 from 2.24.0-alpha -> 2.15.0-alpha
- opentelemetry-logback-appender-1.0 from 2.24.0-alpha -> 2.15.0-alpha

* rollback azure-client-sdk-parent linting extensions from 1.0.0-beta.2 t0 beta.1

* revert linting extensions to beta2

* remove comments with old code

* add logging for errors

* remove catches for double close issue and okay status

* recursively delete files then delete the directory

* change to sync deletes, refactor for easier reading

* restructing share clean up so super calls only once

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* fix all deletes to make sync and wrap in try-catch

* fix tests so that super.globalCleanupAsync() is only called once

* change telemetry to loggin only returns final state instead of failed retries when ultimately successful

* undo versio downgrade for linting-extensions

* Fixing spacing in error messages

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor datalake delete all so that it is easier to read

* refactor runAsync in ShareScenarioBase so retry failures dont show as failures upon success

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
browndav-msft added a commit that referenced this pull request May 1, 2026
* removed enableDeterministic

* change .delete() to .deleteIfExists()

* remove Sinks.EmitFailureHandler.FAIL_FAST from CrcInputStream

- read functions had FAIL_FAST which would throw an error when  the stream had reached then end and we wanted to read from the stream again. So we removed from  both reads.
- refactor code so that the exit criteria is a tthe beginning
- refactor the emitContentInfo for dry

* prevent crashes on reattempted close on stream

- changed emitValue to tryEmitValue
- remove Sinks.EmitFailureHandler.FAIL_FAST so that multiple closes does not cause an error to be thrown

* fix telemetry so that it doesnt swallow errors

* roll back two deps because they were causing failures in the containers

- opentelemetry-runtime-telemetry-java8 from 2.24.0-alpha -> 2.15.0-alpha
- opentelemetry-logback-appender-1.0 from 2.24.0-alpha -> 2.15.0-alpha

* rollback azure-client-sdk-parent linting extensions from 1.0.0-beta.2 t0 beta.1

* revert linting extensions to beta2

* remove comments with old code

* add logging for errors

* remove catches for double close issue and okay status

* recursively delete files then delete the directory

* change to sync deletes, refactor for easier reading

* restructing share clean up so super calls only once

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* fix all deletes to make sync and wrap in try-catch

* fix tests so that super.globalCleanupAsync() is only called once

* change telemetry to loggin only returns final state instead of failed retries when ultimately successful

* undo versio downgrade for linting-extensions

* Fixing spacing in error messages

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor datalake delete all so that it is easier to read

* refactor runAsync in ShareScenarioBase so retry failures dont show as failures upon success

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
browndav-msft added a commit to browndav-msft/azure-sdk-for-java that referenced this pull request May 6, 2026
* removed enableDeterministic

* change .delete() to .deleteIfExists()

* remove Sinks.EmitFailureHandler.FAIL_FAST from CrcInputStream

- read functions had FAIL_FAST which would throw an error when  the stream had reached then end and we wanted to read from the stream again. So we removed from  both reads.
- refactor code so that the exit criteria is a tthe beginning
- refactor the emitContentInfo for dry

* prevent crashes on reattempted close on stream

- changed emitValue to tryEmitValue
- remove Sinks.EmitFailureHandler.FAIL_FAST so that multiple closes does not cause an error to be thrown

* fix telemetry so that it doesnt swallow errors

* roll back two deps because they were causing failures in the containers

- opentelemetry-runtime-telemetry-java8 from 2.24.0-alpha -> 2.15.0-alpha
- opentelemetry-logback-appender-1.0 from 2.24.0-alpha -> 2.15.0-alpha

* rollback azure-client-sdk-parent linting extensions from 1.0.0-beta.2 t0 beta.1

* revert linting extensions to beta2

* remove comments with old code

* add logging for errors

* remove catches for double close issue and okay status

* recursively delete files then delete the directory

* change to sync deletes, refactor for easier reading

* restructing share clean up so super calls only once

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* fix all deletes to make sync and wrap in try-catch

* fix tests so that super.globalCleanupAsync() is only called once

* change telemetry to loggin only returns final state instead of failed retries when ultimately successful

* undo versio downgrade for linting-extensions

* Fixing spacing in error messages

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor datalake delete all so that it is easier to read

* refactor runAsync in ShareScenarioBase so retry failures dont show as failures upon success

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ibrandes added a commit that referenced this pull request Jun 2, 2026
* adding stress tests for content validation decoder

* fix TelemetryHelper, add tru to registerOberservers()

* Storage - Fix Flaky Stress Tests (#48359)

* removed enableDeterministic

* change .delete() to .deleteIfExists()

* remove Sinks.EmitFailureHandler.FAIL_FAST from CrcInputStream

- read functions had FAIL_FAST which would throw an error when  the stream had reached then end and we wanted to read from the stream again. So we removed from  both reads.
- refactor code so that the exit criteria is a tthe beginning
- refactor the emitContentInfo for dry

* prevent crashes on reattempted close on stream

- changed emitValue to tryEmitValue
- remove Sinks.EmitFailureHandler.FAIL_FAST so that multiple closes does not cause an error to be thrown

* fix telemetry so that it doesnt swallow errors

* roll back two deps because they were causing failures in the containers

- opentelemetry-runtime-telemetry-java8 from 2.24.0-alpha -> 2.15.0-alpha
- opentelemetry-logback-appender-1.0 from 2.24.0-alpha -> 2.15.0-alpha

* rollback azure-client-sdk-parent linting extensions from 1.0.0-beta.2 t0 beta.1

* revert linting extensions to beta2

* remove comments with old code

* add logging for errors

* remove catches for double close issue and okay status

* recursively delete files then delete the directory

* change to sync deletes, refactor for easier reading

* restructing share clean up so super calls only once

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* fix all deletes to make sync and wrap in try-catch

* fix tests so that super.globalCleanupAsync() is only called once

* change telemetry to loggin only returns final state instead of failed retries when ultimately successful

* undo versio downgrade for linting-extensions

* Fixing spacing in error messages

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor datalake delete all so that it is easier to read

* refactor runAsync in ShareScenarioBase so retry failures dont show as failures upon success

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* changes to cvdownload content, lazyload versus eagerloading

* update to TelemetryHelper based on previous cherry picked stress tests fixes

* Fix storage stress fault injector certificate trust

Export the fault injector certificate as PEM and wait for it before importing it into the Java truststore so storage stress tests fail fast instead of hitting PKIX errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* bump opentelemetry version

* add cv tests to App.class

* add script to delete resource groups

* update scenarios matrix with tests for cv

* fixing stress tests

* stageblocksmall scenario adjustment

* wip

* avoid depending on raw short baseName being available globally

* dep pinning

* reversion

* adding back

* wip

* storageseekablebytechannel change

* bare minimum changes

* removing perf core change

* removing redundant test file and non-blob package changes

* removing redundant test file and non-blob package changes

* renaming files and hardcoding crc64 option

* removing unused test

* removing unused imports

---------

Co-authored-by: browndav <browndav@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Local Merge <merge@local.tmp>
Co-authored-by: Isabelle <ibrandes@microsoft.com>
ibrandes added a commit that referenced this pull request Jun 23, 2026
* Crc polynomial (#43752)

* Message encoder (#43803)

* wip

* basic message encoder logic working

* removing print statements and making slightly more readable

* fixing several bugs

* adding more tests

* adding comments for building purposes and to branch off for service testing

* wip

* wip

* working encode that takes in bytebuffer

* removing redundant 'this' and making small readability changes

* fixing flag bug, adding more comments, adjusting incorrect test case

* adding structuredmessage package in implemenation and addressing other comments

* refactoring

* adding more tests, adjusting test encoder, adding more validation

* re-ordering empty buffer return

* adding correct comments

* addressing comments and fixing ci issues

* trying to resolve spotbugs issue

* formatting

* Extracting non-decoder changes from the decoder PR (#45546)

* creating class

* replacing encoder constants with new class constants

* adding fromValue to StructuredMessageFlags

* updating module info to contain more packages

* style

* undoing module info change

* Storage Content Validation - Encoder Performance Improvements (#47531)

* adjusting encoder logic

* adjusting tests to work with encoder

* addressing copilot comments

* adding more documentation

* Storage - Content Validation Public Interface (#48074)

* public facing interface wip

* adjusting output stream constructors

* removing redundant apis

* fixing pageblob api

* bloboutputstream adjustment

* wip

* wip

* importing things correctly

* formatting

* throwing error with client logger

* fixing revapi visibility increased error

* overload adjustments

* adding final to options bags and hopefully resolving revapi error

* more edits

* more edits

* more edits

* spotless

* spotless

* more edits

* removing javadoc again

* Storage - Content Validation Message Encoder Perf Updates (#47158)

* all perf adjustments

* addressing copilot comments

* Consolidate content validation types under contentvalidation package (#48272)

* Storage - Content Validation Encoder Pipeline Implementation (#48354)

* adding perf to message encoder tests

* changing package name

* changing package name

* moving checksum algorithm to new package

* wip

* moving storageschecksumalgorithm out of impl so it can actually be used

* removing unused file

* bruh

* small cleanups

* implementation for other APIs

* test updates

* undoing silly agent changes

* async tests

* perf tests for all APIs

* new path for crc64s without accessible array

* md5 compatibility tests

* progress reporter tests

* changing upload file test to stream file

* consolidating conflicting transactional checksum logic

* addressing copilot comments

* changing policy to compute crc64 header in a non-blocking manner

* fixing crc64 policy

* addressing copilot comments

* deleting perf tests

* more tests

* addressing more copilot comments

* adding recordings and marking multi part tests as live only due to the random block ids

* removing unused tests

* updating assets

* addressing github comments

* addressing comments

* renaming missed setters

* idk

* mode resolver cleanup

* adjusting mode resolver tests

* un-deprecating compute md5

* addressing API view comments

* addressing comments

* swapping test behavior for new md5 compatibility util

* wip

* adding validation to prevent progress listener being used with content val

* adding comment about flux.generate in encoder class

* adding recordings

* removing unused imports

* Storage - Content Validation Decoder Implementation (#47016)

* adding the StructuredMessageDecoder

* adding the pipeline policy changes

* smart retry changes

* fixing smart retry impl

* smart retry changes

* smart retry changes

* smart retry changes

* smart retry changes

* adding content validation tests

* code refactoring

* fixing errors i introduced :(

* addressing review comments

* code refactoring based on latest review comments

* code refactoring based on latest review comments

* simplifying retry mechanism

* removing dead code

* addressing Kyle's review comments

* addressing latest review comments

* refactoring based on latest review comments

* refactoring based on latest review comments

* refactoring based on latest review comments

* refactoring based on latest review comments from kyle

* expanding test coverage

* removing unused imports

* recordings

* adding documentation to decoder classes

* small fixes and failure path tests

* addressing context comment

* analyze error

* removing close override from decodedresponse

* line removal

---------

Co-authored-by: Isabelle <ibrandes@microsoft.com>

* Storage Content Validation - Defer MD5 + CRC64 Val Conflict to Service (#48999)

* impl and tests

* cleanup

* updating assets

* strengthening sync assertations

* Storage Content Validation - adding failure tests for content validation decoder (#49073)

* adding failure tests for content validation decoder

* adding Decoder Random Byte Failure Case Test

* rearrange code to make it a little more human readable

* fix linting

---------

Co-authored-by: browndav <browndav@microsoft.com>

* Storage Content Validation - Audit DecodedResponse (#49147)

* Audit DecodedResponse: tighten override surface, pin UTF-8, add unit tests

* Reduce DecodedResponse to minimal override surface

Strip overrides and tests that aren't required for transparent HttpResponse behavior, leaving exactly the compiler-required abstract methods plus one discretionary override that fixes a proven base-class bug.

DecodedResponse.java:
- Remove close() override. Current consumers fully drain the body Flux, so Reactor's onComplete signals release the underlying transport; the explicit close-forwarding was defensive against a try-with-resources / status-only pattern that no caller in the codebase actually uses.
- Collapse no-arg getBodyAsString() to delegate to the charset overload, pinning UTF-8 in one place instead of duplicating the lambda.
- Final override surface (8 methods): the 7 abstract methods on HttpResponse in azure-core 1.57.1 (compiler-required) plus getBodyAsBinaryData, which is concrete in the base but seeds BinaryData with the wire Content-Length header, making BinaryData.getLength() return the encoded size (frames + CRC trailers) instead of the decoded payload size.

DecodedResponseTests.java:
- Remove closeDelegatesToWrappedResponse and closeDoesNotSubscribeToDecodedBody (no override left to validate).
- Drop the close-counting assertion from the writeBodyTo test and rename it to inheritedWriteBodyToWritesDecodedBytes; it now uses MockHttpResponse directly.
- Strengthen getBodyAsBinaryDataReportsDecodedSizeNotContentLength: assert data.getLength() equals the decoded size (post-consumption). Without the override this returns 71 instead of 7, empirically reproduced.
- Drop now-unused trackingResponse helper, AtomicInteger import.

Tests: 10 of 10 passing. Each test maps 1:1 to one override or one inherited integration; no test is redundant.

* some code cleanup

* Address Copilot PR #49147 review comments

DecodedResponse.java (comment r3220562536):
- Restore HttpResponse#getBodyAsString() base contract by switching from unconditional UTF-8 to CoreUtils.bomAwareToString(bytes, contentType), matching BufferedHttpResponse's idiom. The previous UTF-8 pin silently dropped BOM detection and Content-Type charset honoring, which callers viewing this as a generic HttpResponse expect.

DecodedResponseTests.java (comment r3220562553):
- Add inheritedGetBodyAsBinaryDataReturnsDecodedBytes: exercises the inherited HttpResponse#getBodyAsBinaryData() and asserts the bytes match the decoded payload. Uses a divergent Content-Length header to make the wire vs decoded distinction explicit and guard against header-forwarding regressions.
- Add getBodyAsStringHonorsCharsetFromContentTypeHeader: proves the bom-aware fix actually honors a charset declared in Content-Type (would fail if the previous UTF-8 pinning were still in place).
- Add getBodyAsStringDetectsUtf8BomAndStripsIt: pins the BOM-detection arm of CoreUtils.bomAwareToString.
- Update getBodyAsStringDefaultsToUtf8WhenNoCharsetSpecified docstring to describe the new bom-aware fallback semantics rather than the old unconditional UTF-8 behavior.

Tests: 12 of 12 passing.

* some code cleanup

* analyze error

---------

Co-authored-by: Isabelle <ibrandes@microsoft.com>

* Storage Content Validation - Assert Request and Response Headers for Decoder Tests (#49075)

* add checks for response headers

* fix linting

* refactor async, change messageDownloadRequestHeaders signatures

* fix methods with wrong method names

* refactor sync

* remove unnecessary helper in BlobTestBase

* reuse hasStructuredMessageDownloadRequestHeaders with List<HttpHeaders>

* remove unused imports

* apply copilot suggestions

* fix linting

* inline local variables

* remove try-finally, replace with @tempdir

* add checks for response headers

* add recording for downloadStreamWithResponseContentValidationRange

* readd recording

* rerecord recordings

* Storage Content Validation - Verify Download Progress Listener Support (#49157)

* tests and blob client changes

* addressing copilot comments

* updating assets

* Storage Content Validation - Fuzzy Upload Tests (#49031)

* tests and assets

* addressing copilot comments

* making things actually fuzzy

* cleanup

* cleanup

* addressing copilot comments

* recordings

* resolving conflicts

* updating assets

* Storage Content Validation - adding fuzzy tests for content validation decoder (#49058)

* adding fuzzy tests for content validation decoder

* adding recordings

* adding few fuzzy tests

* randomizing fuzzy test payloads

* randomizing fuzzy test payloads

* fixing code review comments

* fix spotless formatting violation in BlobContentValidationAsyncDownloadTests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Local Merge <merge@local.tmp>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* Storage - Content Validation Decoder Dynamic Segment Size Tests and Large GET Behavior Notes (#49172)

* tests for dynamic segment size encoding and decoding

* cleanup

* cleanup

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* style

* cant change pr name while ci is running i guess. no-op change

* cleaning up test file

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Storage - Decoder Perf Improvements (#49205)

* refactoring

* removing unused code

* reverting unecessary changes

* reverting unecessary changes

* reverting unecessary changes

* not pre-allocating entire byte array of segment size

* renaming variable

* adding back unecessary removals

* renaming variable

* addressing copilot comments

* Storage - Content validation content-length override (#49226)

* content length override changes

* content length override changes

* removing stuff

* addressing review comments

* addressing review comments

* addressing review comments

* resolving merge conflicts

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fixing spotbugs

* fixing spellchecks

---------

Co-authored-by: Local Merge <merge@local.tmp>
Co-authored-by: Isabelle <141270045+ibrandes@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Storage - Content Validation Decoder Stress Tests (#49255)

* adding stress tests for content validation decoder

* fix TelemetryHelper, add tru to registerOberservers()

* Storage - Fix Flaky Stress Tests (#48359)

* removed enableDeterministic

* change .delete() to .deleteIfExists()

* remove Sinks.EmitFailureHandler.FAIL_FAST from CrcInputStream

- read functions had FAIL_FAST which would throw an error when  the stream had reached then end and we wanted to read from the stream again. So we removed from  both reads.
- refactor code so that the exit criteria is a tthe beginning
- refactor the emitContentInfo for dry

* prevent crashes on reattempted close on stream

- changed emitValue to tryEmitValue
- remove Sinks.EmitFailureHandler.FAIL_FAST so that multiple closes does not cause an error to be thrown

* fix telemetry so that it doesnt swallow errors

* roll back two deps because they were causing failures in the containers

- opentelemetry-runtime-telemetry-java8 from 2.24.0-alpha -> 2.15.0-alpha
- opentelemetry-logback-appender-1.0 from 2.24.0-alpha -> 2.15.0-alpha

* rollback azure-client-sdk-parent linting extensions from 1.0.0-beta.2 t0 beta.1

* revert linting extensions to beta2

* remove comments with old code

* add logging for errors

* remove catches for double close issue and okay status

* recursively delete files then delete the directory

* change to sync deletes, refactor for easier reading

* restructing share clean up so super calls only once

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* incorporate copilot suggestions

* fix all deletes to make sync and wrap in try-catch

* fix tests so that super.globalCleanupAsync() is only called once

* change telemetry to loggin only returns final state instead of failed retries when ultimately successful

* undo versio downgrade for linting-extensions

* Fixing spacing in error messages

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor datalake delete all so that it is easier to read

* refactor runAsync in ShareScenarioBase so retry failures dont show as failures upon success

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* changes to cvdownload content, lazyload versus eagerloading

* update to TelemetryHelper based on previous cherry picked stress tests fixes

* Fix storage stress fault injector certificate trust

Export the fault injector certificate as PEM and wait for it before importing it into the Java truststore so storage stress tests fail fast instead of hitting PKIX errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* bump opentelemetry version

* add cv tests to App.class

* add script to delete resource groups

* update scenarios matrix with tests for cv

* fixing stress tests

* stageblocksmall scenario adjustment

* wip

* avoid depending on raw short baseName being available globally

* dep pinning

* reversion

* adding back

* wip

* storageseekablebytechannel change

* bare minimum changes

* removing perf core change

* removing redundant test file and non-blob package changes

* removing redundant test file and non-blob package changes

* renaming files and hardcoding crc64 option

* removing unused test

* removing unused imports

---------

Co-authored-by: browndav <browndav@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Local Merge <merge@local.tmp>
Co-authored-by: Isabelle <ibrandes@microsoft.com>

* Storage - Content Validation Encoder Stress Tests (#48979)

* Add encoder stress tests

* enabling fault injector

* restoring commitblocklist

* renaming files and hardcoding crc64 option

* adding scenarios back to app.java

---------

Co-authored-by: Rabab Ibrahim <ibrahimr@microsoft.com>
Co-authored-by: Isabelle <141270045+ibrandes@users.noreply.github.com>
Co-authored-by: Isabelle <ibrandes@microsoft.com>
Co-authored-by: browndav <browndav@microsoft.com>
Co-authored-by: Local Merge <merge@local.tmp>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core azure-core Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants