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

[Unified Recorder] Investigate ResetSanitizer #18222

Closed
HarshaNalluru opened this issue Oct 16, 2021 · 4 comments
Closed

[Unified Recorder] Investigate ResetSanitizer #18222

HarshaNalluru opened this issue Oct 16, 2021 · 4 comments
Assignees
Labels
test-utils-recorder Label for the issues related to the common recorder
Milestone

Comments

@HarshaNalluru
Copy link
Member

#17379 added the ResetSanitizer but the feature doesn't seem to work as expected.
Investigate with @scbedd and find a way to fix it, update docs, add/unskip test.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 16, 2021
@HarshaNalluru HarshaNalluru added test-utils-recorder Label for the issues related to the common recorder and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Oct 16, 2021
@HarshaNalluru HarshaNalluru added this to the Backlog milestone Oct 16, 2021
@HarshaNalluru HarshaNalluru self-assigned this Oct 16, 2021
@timovv timovv modified the milestones: [2022] February, [2022] March Feb 9, 2022
@timovv timovv modified the milestones: [2022] March, [2022] April Mar 14, 2022
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this issue Mar 15, 2022
update readme (Azure#18222)

* update readme

* Update readme.python.md

* Update readme.python.md
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this issue Mar 15, 2022
update readme (Azure#18222)

* update readme

* Update readme.python.md

* Update readme.python.md
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this issue Mar 15, 2022
update readme (Azure#18222)

* update readme

* Update readme.python.md

* Update readme.python.md
@timovv timovv modified the milestones: [2022] April, [2022] May Apr 4, 2022
@timovv
Copy link
Member

timovv commented Apr 19, 2022

I did a bit of digging here. During record mode, sanitizers are not applied until recording is stopped and we're writing the recording to disk. This means that if we do something like:

  1. add a sanitizer
  2. make a request
  3. add ResetSanitizer (this removes the entry for the sanitizer added in (1))
  4. make another request

Then the sanitizer will not be applied to either of the requests, since the sanitizers are only applied after all the requests have happened and the recording is complete. This means that ResetSanitizer doesn't actually do anything useful if placed in the middle of the test.

Our current ResetSanitizer test assumes that the above works, with the sanitizer only being applied to the first request.

In playback mode, the situation is different, with sanitizers being applied as each request comes in.

Is this a bug or working as intended? Have we ever actually come across a need for ResetSanitizer to be used in this way?

@scbedd
Copy link
Member

scbedd commented May 2, 2022

@timovv This is a product of adding features without thinking holistically of the process.

  1. Sanitizers apply at save time, because I had the thought in the back of my head about session vs request level Sanitizers. EG a sanitizer that applies, but requires the full context of the recording to properly apply. That would be implemented in our ContinuationSanitizer. Aside from that, we don't have any sanitizers that would require that full recording context IIRC.
  2. ResetSanitizers route was added because necessity. Folks needed to be able to reset their sanitizers.
  3. We never adjusted where sanitizers apply due to 1), but probably should have when we added ResetSanitizers.
  4. To my knowledge, other than tests exercising usage of the test-proxy, no, I do not believe anyone changes sanitizers while a recording is ongoing. From the perspective of "need", I don't think this issue is super high unfortunately.

I have adjusted the naming of this issue to more properly reflect our discussion here.

EDIT: I will not rename this issue. I got here by notifications and didn't notice this was sdk-for-js. Will post new issue in sdk-tools.

@timovv
Copy link
Member

timovv commented May 2, 2022

Thanks for the follow up, Scott. Agreed that this is low priority. I'll update the title of this issue too and leave it in the backlog.

@timovv
Copy link
Member

timovv commented May 2, 2022

Actually, on second thought, I think that the new issue covers this one well. I'll close this one out.

@timovv timovv closed this as completed May 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
test-utils-recorder Label for the issues related to the common recorder
Projects
None yet
Development

No branches or pull requests

3 participants