[BUG] `IgnoredHeaders` are not excluded from result comparison
See original GitHub issueLibrary name and version
Azure.Core.TestFramework
Describe the bug
According to the guide, adding headers through IgnoredHeaders.Add("XXX")
should exclude those headers from result comparison.
However, I have a PR which will add repeatable request headers in some SDKs. Those headers should be excluded, because their value is automatically set by SDK and its value will change each time. So I add those headers as ignored headers. But the test still fails.
Here is a failed case:
RevokeTest
failed because extra header is found. Here is the error log in pipeline (can be reproduced on local).- The original test case is here.
- The invoked API client method is https://github.com/Azure/azure-sdk-for-net/blob/8ff2023034367ab4936bf285372a0c8aae625baf/sdk/purview/Azure.Analytics.Purview.Share/src/Generated/AcceptedSentSharesClient.cs#L293
- In the PR, the
repeatabilityRequestId
parameter is removed from the API client method. That value is automatically set in the SDK at runtime. - Previously in the test case, null value is set for
repeatabilityRequestId
. So in existing test recording, there is norepeatabilityRequestId
. - I’ve added those headers into
IgnoredHeaders
(see here), and the error still exist.
Expected behavior
IgnoredHeaders
should be excluded from result comparison.
Actual behavior
IgnoredHeaders
is not excluded from result comparison.
Reproduction Steps
See the description.
Environment
No response
Issue Analytics
- State:
- Created 2 months ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
archerzz (Mingzhe Huang) · GitHub
[BUG] IgnoredHeaders are not excluded from result comparison ... Describe the bug According to the guide, adding headers through IgnoredHeaders.
Read more >What's the difference between zuul.ignoredHeaders and ...
Ignored headers are the headers that are totally ignored once traffic reaches Zuul. In other words, Zuul ignores such headers when sending ...
Read more >bug-gnu-emacs (date)
January 31, 2021 ·, Stefan Monnier, 23:37 ·, Eli Zaretskii, 22:37 ·, Basil L. Contovounesios, 22:22 ·, Stefan Monnier, 21:46 ·, Dmitry Gutov,...
Read more >Spring Cloud Netflix
RELEASE. This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other ...
Read more >Spring Cloud Netflix
When calls to a particular service reach a certain threshold (20 failures in 5 seconds is the default in Hystrix), the circuit opens...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a back compat property that has the behavior that is being requested here - https://github.com/Azure/azure-sdk-for-net/blob/8ff2023034367ab4936bf285372a0c8aae625baf/sdk/core/Azure.Core.TestFramework/src/RecordedTestBase.cs#L173
We intentionally hid this property for all the reasons that @m-nash mentioned.
@m-nash for the repeatability request header changes, 8 SDKs are impacted. And 4 of them require re-recording. 2 of 4 have good test cases so that re-recording is done easily. The remaining 2 SDKs have their test cases tightly bound to service teams’ own testing environments.
Azure.Communication.CallingServer
: 18 of 155 test cases failedAzure.Analytics.Purview.Share
: 6 of 36 test cases failedI’ve modified the test recordings to make the tests pass. I agree that for such number of impacted test cases, modifying test recordings is a better option.
Closing this issue.