Repository navigation
fix(amqp): repair cleanup test fixtures - #7535
Open
Johnathan W (j7nw4r) wants to merge 1 commit into
Open
Johnathan W (j7nw4r) wants to merge 1 commit into
Johnathan W (j7nw4r) wants to merge 1 commit into
Conversation
Move retry assertions outside the death-test macro to avoid duplicate GoogleTest labels on MSVC. Release mock link and session owners during shutdown. Log the known session-End error after peer closure and report other shutdown errors as test failures. Test repeated shutdown and idle state before mock destruction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24a4d885-ae9e-4ead-aecb-b07d53634716
|
Azure Pipelines: Successfully started running 3 pipeline(s). 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Johnathan W (j7nw4r)
marked this pull request as ready for review
November 6, 2026 21:12
Johnathan W (j7nw4r)
requested review from
Larry Osterman (LarryOsterman),
Rick Winter (RickWinter),
Josue Gomez (SwayGom),
Anton Kolesnyk (antkmsft),
Ashish Chhabria (axisc),
Eric Lam (MSFT) (hmlam),
Amit Bhatia (meetamitbhatia),
Sagar Patel (sagar0207),
SJ (sjkwak) and
Jeff Fisher (xirzec)
as code owners
November 6, 2026 21:12
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-fixture cleanup changes.
No open issues 🎉
What changed in this PR
Repairs AMQP and Event Hubs cleanup test fixtures introduced in #7511, supporting release preparation in #7532 without changing production code or release metadata.
Changes:
- Moves retry assertions into a helper outside
EXPECT_EXITto avoid duplicate GoogleTest labels on MSVC. - Orders mock resource cleanup, prevents repeated shutdown, and distinguishes expected session-end failures after connection termination from unexpected errors.
- Extends discovery cleanup tests to verify repeated shutdown and idle polling before mock destruction.
| File | Description |
|---|---|
sdk/eventhubs/azure-messaging-eventhubs/test/ut/properties_cleanup_test.cpp |
Adds repeated-stop and idle-polling checks. |
sdk/core/azure-core-amqp/test/ut/session_cleanup_tests.cpp |
Extracts retry assertions into an MSVC-compatible helper. |
sdk/core/azure-core-amqp/test/ut/mock_amqp_server.hpp |
Repairs shutdown ordering, resource release, and error handling. |
Review effort: Balanced
Sagar Patel (sagar0207)
approved these changes
Nov 6, 2026
Josue Gomez (SwayGom)
approved these changes
Nov 6, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the AMQP retry death test's MSVC compilation error and the mock-server shutdown failure in Event Hubs cleanup tests.
Motivation
#7511 added both failing tests. The retry test nests exception assertions inside
EXPECT_EXIT, which generates duplicate GoogleTest labels on MSVC. The Event Hubs test closes its client connection before the mock session sends END. That send fails, and the mock destructor retries partial shutdown during stack unwinding.These test-only changes support release preparation in #7532. Production code and release metadata remain unchanged.
Changes
EXPECT_EXIT. Keep the exception, retry, idle-state, and child-exit expectations.runtime_error("Could not end session")only after an observed terminal connection state. Report other session shutdown errors through GoogleTest.Validation
SessionCleanupDeathTest.FailedEndCanBeRetriedpassed in the actual AMQP test executable. Ten isolated runs ofPropertiesCleanupDeathTest.ManagementCloseFailureStillEndsSessionpassed with captured output.TestCbs.CbsOpenNoListenerandTestMessageSendReceive.SenderCloseWhileUnsettledSendIgnoresLateDispositionfailed. An isolated snapshot of upstream commit8021f71052bbf87ccf1c2b470e2af436d37c86ff, with only the required compiler helper fix, produced the same two failures./Zc:preprocessor-and/Zc:preprocessor. This probe tests macro extraction only. A full/Zc:preprocessorbuild failed in vendoredoptionhandler.hwith missingUMOCK_C_PROD_ARG_IN_SIGNATUREandMU_FOR_EACH_2_COUNTED_*macros.AZURE_TEST_MODE=LIVEwith the proxy disabled. Azure live tests remain unrun because service configuration and credentials are unavailable. The Blob checkpoint store integration tests also require Azure Storage.