Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Recording framework isn't correctly recording Content-Length of Head response #13510

Closed
seanmcc-msft opened this issue Jul 16, 2020 · 5 comments · Fixed by #14885
Closed
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage.

Comments

@seanmcc-msft
Copy link
Member

seanmcc-msft commented Jul 16, 2020

In this test, the 2nd to last call is GetProperties(). Its response is supposed to contain the header "Content-Length=1024" (this is what happens in live mode). Unfortunately, it is being recorded as 0. (Line 2292, GitHub won't load the link I tried to create to that specific line.)

I believe this is because the response doesn't have a body, and the recording framework is setting Content-Length = 0 base on the body length, ignoring the actual header.

@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. labels Jul 16, 2020
@JoshLove-msft
Copy link
Member

I just tested this locally and the recording didn't include the HEAD request with the Content-Length of 0. Playback worked fine after re-recording. Is it possible there was a server issue? Can you try to re-record?

@JoshLove-msft JoshLove-msft assigned seanmcc-msft and unassigned pakrym Aug 1, 2020
@seanmcc-msft
Copy link
Member Author

#13917

@kasobol-msft
Copy link
Contributor

I'm still hitting this issue.

What I can see during recording:
image

What recording has:
image

@kasobol-msft kasobol-msft reopened this Sep 3, 2020
@JoshLove-msft
Copy link
Member

@kasobol-msft can you point me to the specific test?

@kasobol-msft
Copy link
Contributor

@JoshLove-msft

[LiveOnly] // https://github.com/Azure/azure-sdk-for-net/issues/13510
public async Task OpenReadAsync()
{
int size = Constants.KB;
await using DisposingContainer test = await GetTestContainerAsync();
// Arrange
var data = GetRandomBuffer(size);
BlockBlobClient blob = InstrumentClient(test.Container.GetBlockBlobClient(GetNewBlobName()));
using Stream stream = new MemoryStream(data);
await blob.UploadAsync(stream);
// Act
Stream outputStream = await blob.OpenReadAsync().ConfigureAwait(false);
byte[] outputBytes = new byte[size];
await outputStream.ReadAsync(outputBytes, 0, size);
// Assert
Assert.AreEqual(data.Length, outputStream.Length);
TestHelper.AssertSequenceEqual(data, outputBytes);
}
that one or any other with this issue link in the comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants