Skip to content

Conversation

@lambdageek
Copy link
Member

@lambdageek lambdageek commented Sep 24, 2021

Checking for MONO_ENV_OPTIONS is not reliable for the mobile test runners because they use the embedding API to enable the interpreter, rather than setting an environment variable.

Instead detect the interpreter by checking the values of the IsDynamicCodeSupported and IsDynamicCodeCompiled runtime features.

Re-enable the System.Threading.Tasks.Dataflow.Tests testsuite on Apple platforms

Fixes #52460

Checking for MONO_ENV_OPTIONS is not reliable for the mobile test runners
because they use the embedding API to enable the interpreter, rather than
setting an environment option.

Instead detect the interpreter by checking the values of the
IsDynamicCodeSupported and IsDynamicCodeCompiled runtime features.
@ghost
Copy link

ghost commented Sep 24, 2021

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Sep 24, 2021

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Checking for MONO_ENV_OPTIONS is not reliable for the mobile test runners because they use the embedding API to enable the interpreter, rather than setting an environment option.

Instead detect the interpreter by checking the values of the IsDynamicCodeSupported and IsDynamicCodeCompiled runtime features.

Re-enable the System.Threading.Tasks.Dataflow.Tests testsuite on Apple platforms

Fixes #52460

Author: lambdageek
Assignees: -
Labels:

area-Infrastructure-mono

Milestone: -

// This is a temporary solution because mono does not support interpreter detection
// within the runtime.
var val = Environment.GetEnvironmentVariable("MONO_ENV_OPTIONS");
return (val != null && val.Contains("--interpreter"));
Copy link
Member

@am11 am11 Sep 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also remove it from eng/pipelines/coreclr/templates/run-performance-job.yml and src/tests/Common/testenvironment.proj?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. We still need to set it when we're running on desktop platforms using Mono, since in that case we're just using the normal libraries test host.

The issue is just that it's not sufficient to check for the environment variable setting to detect whether we're using the interpreter. The RuntimeFeature checks should be accurate on all configurations, AFAIK.

these tests are not running on mono if they're running on .NET Framework
@lambdageek lambdageek merged commit 234b789 into dotnet:main Sep 25, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
@lambdageek lambdageek deleted the fix-gh-52460 branch March 19, 2022 16:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks issues on Mac Catalyst

3 participants