Skip to content

Rewrite 3 MemoryCache tests to not be timing sensitive  #72890

@danmoseley

Description

@danmoseley

GetAndSet_AreThreadSafe_AndUpdatesNeverLeavesNullValues
OvercapacityPurge_AreThreadSafe
AddAndReplaceEntries_AreThreadSafe

These were inherited from aspnet/caching but have been disabled as they need rewriting to not be racy.

example failure

System.AggregateException : One or more errors occurred.
---- System.Threading.Tasks.TaskCanceledException : A task was canceled.


Stack trace
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.Extensions.Caching.Memory.MemoryCacheSetAndRemoveTests.OvercapacityPurge_AreThreadSafe() in /_/src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs:line 655
----- Inner Stack Trace -----

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Extensions-Cachingdisabled-testThe test is disabled in source code against the issuehelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions