Skip to content

CI: DisabledTracingDoesNotAllocateDuringReferenceOperations intermittently reports allocations #13726

Done

Description

@simonrozsival

Android framework version

net12.0-android (Preview)

Affected platform version

dotnet/android CI, Debug Android runtime tests on a macOS runner (net12.0|x64 as reported by the test runner).

Description

ManagedObjectReferenceManagerTests.DisabledTracingDoesNotAllocateDuringReferenceOperations intermittently reports allocations on the test thread after its warm-up, even though reference tracing is disabled. The test compares GC.GetAllocatedBytesForCurrentThread() before and after 1,000 reference-operation iterations and expects no allocations.

The allocation source and whether this is test interference, initialization, or an actual runtime allocation are not yet known. Investigate the cause and make the test reliable without masking real allocations in the disabled-tracing path.

The failure has occurred on unrelated builds, and is listed in the CI flakiness inventory #13716:

Steps to Reproduce

Run the Debug Android runtime tests in CI, including DisabledTracingDoesNotAllocateDuringReferenceOperations. The failure is intermittent; a deterministic standalone reproduction is not yet known.

Did you find any workaround?

None known.

Relevant log output

failed DisabledTracingDoesNotAllocateDuringReferenceOperations
  Assertion failed. Expected values to be equal.

expected: 80025328
actual:   80027760

Assert.AreEqual(before, after)
   at Xamarin.Android.RuntimeTests.ManagedObjectReferenceManagerTests.DisabledTracingDoesNotAllocateDuringReferenceOperations() in tests/Mono.Android-Tests/Mono.Android-Tests/Android.Runtime/ManagedObjectReferenceManagerTests.cs:line 199

The reported difference is 2,432 bytes.

Activity

  1. added
    needs-triage
    on Nov 23, 2026
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

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions