Skip to content

[Mono] OptionsMonitorTest.TestCurrentValueDoesNotAllocateOnceValueIsCached Test Fails #67611

Description

@steveisok

Found in the rolling build and the test fails with:

[Fact]
public void TestCurrentValueDoesNotAllocateOnceValueIsCached()
{
var monitor = new OptionsMonitor<FakeOptions>(
new OptionsFactory<FakeOptions>(Enumerable.Empty<IConfigureOptions<FakeOptions>>(), Enumerable.Empty<IPostConfigureOptions<FakeOptions>>()),
Enumerable.Empty<IOptionsChangeTokenSource<FakeOptions>>(),
new OptionsCache<FakeOptions>());
Assert.NotNull(monitor.CurrentValue); // populate the cache
long initialBytes = GC.GetAllocatedBytesForCurrentThread();
_ = monitor.CurrentValue;
Assert.Equal(0, GC.GetAllocatedBytesForCurrentThread() - initialBytes);
}

Assert.Equal() Failure
Expected: 0
Actual:   24

Metadata

Metadata

Assignees

Labels

area-GC-monodisabled-testThe test is disabled in source code against the issueos-iosApple iOSos-tvosApple tvOSruntime-monospecific to the Mono runtime

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions