`RuntimeInformation.ProcessArchitecture` returns X64 architecture for Arm64 tests
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 1d 13m
- Merged PRs (30d)
- 85
Description
### .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
1. Add Arm64 as an unsupported architecture on a unit test.
2. Search for the test in CI pipeline test results.
Contributor guide
Assessment
This issue has not been assessed yet.