Skip to content

[mono] Test failed: System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists #31853

Open

Description

@MaximLipnin

System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists fails on mono. This test is disabled in CoreFX.issues.rsp file, but it will be moved into its respective xUnit test with ActiveIssue in #2087.

System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists [FAIL]
    'ProfileOptimization_CheckFileExists_17_9fc17555' does not exist
        Expected: True
        Actual:   False
        Stack Trace:
             at System.Runtime.Tests.ProfileOptimizationTest.ProfileOptimization_CheckFileExists()
             at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Activity

  1. added
    untriaged
    on Feb 6, 2020
  2. added
    runtime-mono
    on Feb 7, 2020
  3. removed
    untriaged
    on Jun 22, 2020
  4. added this to the 6.0.0 milestone on Jun 22, 2020
  5. modified the milestones: 6.0.0, 7.0.0 on Aug 12, 2021
  6. dakersnar commented on Aug 8, 2022

    @dakersnar
    Contributor

    @lambdageek Are you planning on fixing this for 7.0? If now, can you triage this out to Future? Thanks.

  7. modified the milestones: 7.0.0, Future on Aug 13, 2022
  8. tannergooding commented on Jul 24, 2026

    @tannergooding
    Member

    Still disabled and this looks like a genuine feature gap rather than flakiness.

    The test is still guarded by [ActiveIssue("https://github.com/dotnet/runtime/issues/31853", TestRuntimes.Mono)] in ProfileOptimization.cs, and the root cause is that Mono doesn't implement profile optimization (multicore JIT). The AssemblyLoadContext methods backing ProfileOptimization.SetProfileRoot/StartProfile are empty no-ops on Mono:

    // src/mono/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.Mono.cs
    public void SetProfileOptimizationRoot(string directoryPath) { }
    public void StartProfileOptimization(string? profile) { }

    Where-as CoreCLR P/Invokes into MultiCoreJIT_InternalSetProfileRoot/MultiCoreJIT_InternalStartProfile, which actually write the profile file. Since Mono does nothing, the profile file is never created, so CheckProfileFileExists fails after its 5s grace wait -- exactly what the ActiveIssue guards against.

    So this can''t pass on Mono until multicore JIT profile writing is implemented there (or the test is made conditional on the feature being supported). Retargeting from area-System.Runtime to area-Codegen-JIT-mono since the gap is in JIT behavior, not the managed API.

    Note

    This analysis was generated by GitHub Copilot.

  9. dotnet-policy-service commented on Jul 24, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @steveisok, @vitek-karas
    See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Codegen-JIT-monoruntime-mono

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions