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
Found in the rolling build and the test fails with:
runtime/src/libraries/Microsoft.Extensions.Options/tests/Microsoft.Extensions.Options.Tests/OptionsMonitorTest.cs
Lines 473 to 485 in 670262a