question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`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: image

Steps to reproduce

  1. Add Arm64 as an unsupported architecture on a unit test.
  2. Search for the test in CI pipeline test results.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RussKiecommented, Apr 13, 2022

Tests on ARM64 are run under x64.

0reactions
JeremyKuhnecommented, Apr 4, 2023

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found