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

Conflicting PRs leads to CannotOverwriteExistingCassetteException, No match for the request ... #28465

Open
jiasli opened this issue Feb 27, 2024 · 3 comments
Assignees
Labels
Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team feature-request Similar-Issue
Milestone

Comments

@jiasli
Copy link
Member

jiasli commented Feb 27, 2024

CI failures CannotOverwriteExistingCassetteException, No match for the request ... happens when:

  • PR A bumps the API version for existing requests in a recording YAML, such as from 2023-11-01 to 2024-01-01
  • PR B adds new requests to the recording YAML with the old API version, such as 2023-11-01
============== PR A ===============
request 1: 2023-11-01 -> 2024-01-01
request 2: 2023-11-01 -> 2024-01-01
request 3: 2023-11-01 -> 2024-01-01
============== PR B ===============
request 4:             + 2023-11-01
request 5:             + 2023-11-01
request 6:             + 2023-11-01

Each PR's CI can pass individually.

As adding new lines won't cause merge conflict, both PRs can be merged, but triggers CI failure after merging because of the inconsistent API versions:

2024-02-26T08:30:09.3934011Z         except CannotOverwriteExistingCassetteException as ex:
2024-02-26T08:30:09.3934190Z >           raise AssertionError(ex)
2024-02-26T08:30:09.3934901Z E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_loadbalancer_then_update.yaml') in your current record mode ('once').
2024-02-26T08:30:09.3935712Z E           No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2024-01-01>) was found.
2024-02-26T08:30:09.3936084Z E           Found 4 similar requests with 0 different matcher(s) :
2024-02-26T08:30:09.3936233Z E           
2024-02-26T08:30:09.3936782Z E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2024-01-01>).
2024-02-26T08:30:09.3937361Z E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
2024-02-26T08:30:09.3937574Z E           Matchers failed :
2024-02-26T08:30:09.3937698Z E           
2024-02-26T08:30:09.3938257Z E           2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2024-01-01>).
2024-02-26T08:30:09.3938785Z E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
2024-02-26T08:30:09.3938994Z E           Matchers failed :
2024-02-26T08:30:09.3939120Z E           
2024-02-26T08:30:09.3939687Z E           3 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2024-01-01>).
2024-02-26T08:30:09.3940242Z E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
2024-02-26T08:30:09.3940465Z E           Matchers failed :
2024-02-26T08:30:09.3940591Z E           
2024-02-26T08:30:09.3941175Z E           4 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2024-01-01>).
2024-02-26T08:30:09.3941718Z E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
2024-02-26T08:30:09.3941942Z E           Matchers failed :

Previous occurrences:

  1. {Eventgrid} Fix eventgrid test api version #19003 (comment)
  2. {AKS} Support reset default value for loadbalancer profile and natgateway profile #28273 (comment), fixed by {AKS}:Update test artifacts in acs #28456
Copy link

Hi @jiasli
Find similar issue #7819.

Issue title Enable logging to file causes some recorded tests to fail.
Create time 2018-11-12
Comment number 1

Please confirm if this resolves your issue.

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 27, 2024

Thank you for opening this issue, we will look into it.

@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team feature-request labels Feb 27, 2024
@yonzhan yonzhan added this to the Backlog milestone Feb 27, 2024
@jsntcy
Copy link
Member

jsntcy commented Mar 1, 2024

#28218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team feature-request Similar-Issue
Projects
None yet
Development

No branches or pull requests

4 participants