`RuntimeInformation.ProcessArchitecture` returns X64 architecture for Arm64 tests
See original GitHub issue.NET version
7.0
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
Tests are run for x86, x64 and arm64 architectures. Some tests could be flaky on a specific architecture, so we introduced an attribute to skip a test when run on a certain architecture (https://github.com/dotnet/winforms/pull/6599). The attribute uses the System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture
property to determine the architecture. However, this property returns Architecture.X64
for arm64 tests, which makes skipping tests for arm64 not working as expected.
For example, while DataGridViewTests.DataGridView_ColumnHeadersHeight_SetWithHandle_GetReturnsExpected
has following attribute:
[ConditionalWinFormsTheory(UnsupportedArchitecture = Architecture.Arm64,
Skip = "Flaky tests, see: https://github.com/dotnet/winforms/issues/6597")]
it is still executed on arm64:
Steps to reproduce
- Add Arm64 as an unsupported architecture on a unit test.
- Search for the test in CI pipeline test results.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
RuntimeInformation.OSArchitecture under emulation - .NET
Code that expects the process architecture should be changed to call RuntimeInformation.ProcessArchitecture instead.
Read more >Identifying the CPU architecture type using C# - ...
RuntimeInformation.ProcessArchitecture. The value returned is one of X86, X64, ARM, ARM64 and gives the architecture of the process it's ...
Read more >Lambda ARM64 Custom Runtime with .NET 6 - no dogma blog
RuntimeInformation.ProcessArchitecture; var dotnetVersion = Environment.Version.ToString(); return $"Architecture: {architecture}, .
Read more >Feb 25, 2022
I'm running all the things :-) System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture works great for UWP and .NET core.
Read more >NET Workflows for arm64 with Amazon CodeCatalyst: Part 1
WriteAsync("Welcome to running ASP.NET Core on AWS Lambda on " + System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Tests on ARM64 are run under x64.
@RussKie, @dreddy-work if tests on the ARM leg are run on x64, what is the value? How are they any different than the x64 leg?