Azure / Azure/azure-sdk-for-net
ContainerApps Job tests fail with TestRecordingMismatchException when using UseProjectReferenceToAzureClients=true
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 5.2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 407
Description
## Summary
ContainerApps `CreateOrUpdate()` tests for `Microsoft.App/jobs` fail with `TestRecordingMismatchException` when run with `UseProjectReferenceToAzureClients=true`. The recorded sessions use `api-version=2023-05-01` but the source-built `Azure.ResourceManager.AppContainers` sends `api-version=2025-07-01`, causing resource name mismatches due to the `Recording.Random` sequence shift.
## Failing Tests
- `Azure.ResourceManager.AppContainers.Tests.ContainerAppJobTests.CreateOrUpdate()`
- `Azure.ResourceManager.AppContainers.Tests.ContainerAppJobApiTests.CreateOrUpdate()`
## Root Cause
Same class of issue as #57679. The ContainerApps package was updated to a newer API version (2025-07-01) but the test recordings were not re-recorded. When tests run with `UseProjectReferenceToAzureClients=true` (which happens during dependency testing via `TestDependsOnDependency`), the source-built package uses the new API version, shifting the `Recording.Random` sequence and causing resource name mismatches.
## Reproduction
Fails consistently on all platforms (Ubuntu, Windows, macOS) across all frameworks (NET 8.0, 9.0, 10.0, NET462):
- [Build 6106294](https://dev.azure.com/azure-sdk/public/_build/results?buildId=6106294&view=results) - all b5 test batches fail
- [Build 6102688](https://dev.azure.com/azure-sdk/public/_build/results?buildId=6102688&view=results) - same failures
## Fix
Re-record the ContainerApps Job tests with the current API version (2025-07-01).
## Related
- #57679 - Same class of issue (DataFactory tests broken by Storage TypeSpec migration)
- PR #57685 - PR that surfaced this issue by adding TestDependsOnDependency to ContainerApps CI
Contributor guide
Research direction
Start with ContainerAppJobTests.CreateOrUpdate() and ContainerAppJobApiTests.CreateOrUpdate(), then review their existing test recordings and the recording workflow for Azure.ResourceManager.AppContainers. Re-record both tests using API version 2025-07-01 and run them with UseProjectReferenceToAzureClients=true; done means the sessions match without TestRecordingMismatchException across the affected test runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100