Azure / Azure/azure-powershell
SiteRecovery: Test-AsrEvent (V2AEvent) fails on NetCoreApp2.0, Get-AzRecoveryServicesAsrEvent encodes StartTime incorrectly
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
For the SiteRecovery tests in `ScenarioTests\Common`, there is a test called *V2AEvent* (the PS function is *Test-AsrEvent*). This test fails in NetCoreApp2.0 because it cannot find the matching call when `-StartTime` is provided. The date provided in the test has 4 digits in the year (2017). The recording also has 4 digits in the year. However, it seems that when `Get-AzureRmRecoveryServicesAsrEvent` is built for NetCoreApp2.0, the request generates a 2-digit year instead. From the Travis log:
```
Unable to find a matching HTTP request for URL 'GET /Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/canaryexproute/providers/Microsoft.RecoveryServices/vaults/IbizaV2ATest/replicationEvents?$filter=StartTime%20eq%20'8/18/17%202:05:00%20AM'&api-version=2018-01-10'. Calling method Item().
```
The only difference between this request URI and the one in the recording is the date being `17` instead of `2017`. This is a bug that would need to be fixed in the SiteRecovery module so that the URI remains the same when built on NetStandard. I'm assuming the same happens when the tests are ran as NetCoreApp2.1.
### Note
This is a **Linux-specific issue**. I was unable to reproduce locally on Windows. (Maybe Linux defaults to 2-digit years?)
Contributor guide
Assessment
This issue has not been assessed yet.