Azure / Azure/azure-powershell
Random Failure in Test-UpdateExchangeIPv6OnResourceId
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
## Description
The random failure happens to the following line in the function of Test-UpdateExchangeIPv6OnResourceId
`$newipv6 = getPeeringVariable "newIpv6" (newIpV6Address $true $false 0 (getRandomNumber))`
```
function Test-UpdateExchangeIPv6OnResourceId {
# Hard coded name because the resource has to exist and cant be created ad-hoc.
$randNum = getRandomNumber
Write-Debug "Random Number $randNum";
$peerAsn = makePeerAsn $randNum
$resourceGroups = TestSetup-CreateResourceGroup
$resourceGroup = $resourceGroups.ResourceGroupName
$peering = CreateExchangePeering $resourceGroup $peerAsn.Name
Assert-NotNull $peering
$newipv6 = getPeeringVariable "newIpv6" (newIpV6Address $true $false 0 (getRandomNumber))
$oldpeering = $peering
$peering.Connections[0] = $peering.Connections[0] | Set-AzPeeringExchangeConnectionObject -PeerSessionIPv6Address $newipv6
Write-Debug $peering.Name
Assert-ThrowsContains { $update = Update-AzPeering -ResourceId $peering.Id $peering.Connections } "BadArgument"
}
```
Error log of the test case
```
2021-07-05T06:09:53.5146016Z [xUnit.net 00:00:12.12] Microsoft.Azure.Commands.Peering.Test.ScenarioTests.ScenarioExchangePeeringTests.TestUpdateExchangeIPv6OnResourceId [FAIL]
2021-07-05T06:09:55.5249232Z X Microsoft.Azure.Commands.Peering.Test.ScenarioTests.ScenarioExchangePeeringTests.TestUpdateExchangeIPv6OnResourceId [664ms]
2021-07-05T06:09:55.5250417Z EXEC : error Message: [/home/vsts/work/1/s/build.proj]
2021-07-05T06:09:55.5252358Z System.Management.Automation.MethodInvocationException : Exception calling "OffSet" with "4" argument(s): "An invalid IP address was specified.
2021-07-05T06:09:55.5253634Z Parameter name: address"
2021-07-05T06:09:55.5255295Z ---- System.ArgumentException : An invalid IP address was specified.
2021-07-05T06:09:55.5256365Z Parameter name: address
2021-07-05T06:09:55.5256924Z Stack Trace:
2021-07-05T06:09:55.5257521Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2021-07-05T06:09:55.5258145Z at System.Management.Automation.Runspaces.Pipeline.Invoke()
2021-07-05T06:09:55.5258832Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2021-07-05T06:09:55.5259599Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2021-07-05T06:09:55.5260401Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2021-07-05T06:09:55.5261768Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2021-07-05T06:09:55.5263472Z at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
2021-07-05T06:09:55.5282051Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2021-07-05T06:09:55.5283658Z at System.Management.Automation.PowerShell.Invoke()
2021-07-05T06:09:55.5285554Z at Microsoft.WindowsAzure.Commands.ScenarioTest.EnvironmentSetupHelper.RunPowerShellTest(String[] scripts) in /home/vsts/work/1/s/tools/ScenarioTest.ResourceManager/EnvironmentSetupHelper.cs:line 573
2021-07-05T06:09:55.5287538Z at Microsoft.Azure.Commands.Peering.Test.ScenarioTests.TestController.RunPsTestWorkflow(Func`1 scriptBuilder, Action cleanup, String callingClassType, String mockName) in /home/vsts/work/1/s/src/Peering/Peering.Test/ScenarioTests/TestController.cs:line 120
2021-07-05T06:09:55.5296662Z at Microsoft.Azure.Commands.Peering.Test.ScenarioTests.TestController.RunPowerShellTest(XunitTracingInterceptor logger, String[] scripts) in /home/vsts/work/1/s/src/Peering/Peering.Test/ScenarioTests/TestController.cs:line 70
2021-07-05T06:09:55.5299074Z at Microsoft.Azure.Commands.Peering.Test.ScenarioTests.ScenarioExchangePeeringTests.TestUpdateExchangeIPv6OnResourceId() in /home/vsts/work/1/s/src/Peering/Peering.Test/ScenarioTests/ScenarioExchangePeeringTests.cs:line 67
2021-07-05T06:09:55.5301897Z ----- Inner Stack Trace -----
2021-07-05T06:09:55.5303883Z at System.Net.IPAddress..ctor(ReadOnlySpan`1 address)
2021-07-05T06:09:55.5305966Z at System.Net.IPAddress..ctor(Byte[] address)
2021-07-05T06:09:55.5307651Z at Microsoft.Azure.PowerShell.Cmdlets.Peering.Common.HelperExtensionMethods.ToIpAddress(BigInteger self, AddressFamily addressFamily) in /home/vsts/work/1/s/src/Peering/Peering/Common/HelperExtensionMethods.cs:line 91
2021-07-05T06:09:55.5309312Z at Microsoft.Azure.Commands.Peering.Test.ScenarioTests.IPGenerator.OffSet(String ipAddress, Boolean v6, Int32 offset, Boolean hasPrefix) in /home/vsts/work/1/s/src/Peering/Peering.Test/ScenarioTests/IPGenerator.cs:line 65
2021-07-05T06:09:55.5317364Z at CallSite.Target(Closure , CallSite , Object , Object , Boolean , Object , Object )
2021-07-05T06:09:55.5317856Z Standard Output Messages:
2021-07-05T06:09:55.5318401Z Test-UpdateExchangeIPv6OnResourceId
2021-07-05T06:09:55.5318937Z Caught Exception: System.Management.Automation.MethodInvocationException: Exception calling "OffSet" with "4" argument(s): "An invalid IP address was specified.
2021-07-05T06:09:55.5319716Z Parameter name: address" ---> System.ArgumentException: An invalid IP address was specified.
2021-07-05T06:09:55.5320102Z Parameter name: address
2021-07-05T06:09:55.5320408Z at System.Net.IPAddress..ctor(ReadOnlySpan`1 address)
2021-07-05T06:09:55.5320886Z at System.Net.IPAddress..ctor(Byte[] address)
2021-07-05T06:09:55.5321611Z at Microsoft.Azure.PowerShell.Cmdlets.Peering.Common.HelperExtensionMethods.ToIpAddress(BigInteger self, AddressFamily addressFamily) in /home/vsts/work/1/s/src/Peering/Peering/Common/HelperExtensionMethods.cs:line 91
2021-07-05T06:09:55.5322394Z at Microsoft.Azure.Commands.Peering.Test.ScenarioTests.IPGenerator.OffSet(String ipAddress, Boolean v6, Int32 offset, Boolean hasPrefix) in /home/vsts/work/1/s/src/Peering/Peering.Test/ScenarioTests/IPGenerator.cs:line 65
2021-07-05T06:09:55.5323089Z at CallSite.Target(Closure , CallSite , Object , Object , Boolean , Object , Object )
2021-07-05T06:09:55.5323741Z --- End of inner exception stack trace ---
2021-07-05T06:09:55.5324242Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2021-07-05T06:09:55.5325008Z at System.Management.Automation.Runspaces.Pipeline.Invoke()
2021-07-05T06:09:55.5325463Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2021-07-05T06:09:55.5325953Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2021-07-05T06:09:55.5326637Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2021-07-05T06:09:55.5327289Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2021-07-05T06:09:55.5327863Z at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
2021-07-05T06:09:55.5328391Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2021-07-05T06:09:55.5328821Z at System.Management.Automation.PowerShell.Invoke()
2021-07-05T06:09:55.5329345Z at Microsoft.WindowsAzure.Commands.ScenarioTest.EnvironmentSetupHelper.RunPowerShellTest(String[] scripts) in /home/vsts/work/1/s/tools/ScenarioTest.ResourceManager/EnvironmentSetupHelper.cs:line 573
2021-07-05T06:09:55.5329962Z Message: Exception calling "OffSet" with "4" argument(s): "An invalid IP address was specified.
2021-07-05T06:09:55.5330531Z Parameter name: address"
2021-07-05T06:09:55.5331588Z EXEC : PowerShell error Record: Exception calling "OffSet" with "4" argument(s): "An invalid IP address was specified. [/home/vsts/work/1/s/build.proj]
2021-07-05T06:09:55.5332347Z Parameter name: address"
2021-07-05T06:09:55.5333043Z Exception:System.Management.Automation.ParentContainsErrorRecordException: Exception calling "OffSet" with "4" argument(s): "An invalid IP address was specified.
2021-07-05T06:09:55.5333669Z Parameter name: address"
2021-07-05T06:09:55.5334022Z Details:
2021-07-05T06:09:55.5334539Z Script Stack Trace: at newIpV6Address, /home/vsts/work/1/s/src/Peering/Peering.Test/bin/Debug/netcoreapp2.1/ScenarioTests/PeeringCommon.ps1: line 52
2021-07-05T06:09:55.5336204Z at Test-UpdateExchangeIPv6OnResourceId, /home/vsts/work/1/s/src/Peering/Peering.Test/bin/Debug/netcoreapp2.1/ScenarioTests/ScenarioExchangePeeringTests.ps1: line 50
2021-07-05T06:09:55.5336776Z at , : line 1
2021-07-05T06:09:55.5337089Z : Target:
2021-07-05T06:09:55.5337354Z
2021-07-05T06:09:55.5337687Z Caught Exception: System.ArgumentException: An invalid IP address was specified.
2021-07-05T06:09:55.5338073Z Parameter name: address
2021-07-05T06:09:55.5338403Z at System.Net.IPAddress..ctor(ReadOnlySpan`1 address)
2021-07-05T06:09:55.5338771Z at System.Net.IPAddress..ctor(Byte[] address)
2021-07-05T06:09:55.5339305Z at Microsoft.Azure.PowerShell.Cmdlets.Peering.Common.HelperExtensionMethods.ToIpAddress(BigInteger self, AddressFamily addressFamily) in /home/vsts/work/1/s/src/Peering/Peering/Common/HelperExtensionMethods.cs:line 91
2021-07-05T06:09:55.5340529Z at Microsoft.Azure.Commands.Peering.Test.ScenarioTests.IPGenerator.OffSet(String ipAddress, Boolean v6, Int32 offset, Boolean hasPrefix) in /home/vsts/work/1/s/src/Peering/Peering.Test/ScenarioTests/IPGenerator.cs:line 65
2021-07-05T06:09:55.5431677Z at CallSite.Target(Closure , CallSite , Object , Object , Boolean , Object , Object )
2021-07-05T06:09:55.5432485Z Message: An invalid IP address was specified.
2021-07-05T06:09:55.5433058Z Parameter name: address
```
https://dev.azure.com/azure-sdk/public/_build/results?buildId=983143&view=logs&j=ad07b744-5a1a-5d54-7693-fcb02e666633&t=b0841cae-a6b1-5a5c-4ebd-3cc6b3d3163d
## Cost
Contributor guide
Assessment
This issue has not been assessed yet.