dotnet/runtime

Rewrite 3 MemoryCache tests to not be timing sensitive

Chiusa

#72.890 aperta il 26 lug 2022

 (2 commenti) (0 reazioni) (0 assegnatari)C# (5445 fork)batch import
area-Extensions-Cachingdisabled-testhelp wanted

Metriche repository

Star
 (17.886 stelle)
Metriche merge PR
 (Merge medio 12g 11h) (661 PR mergiate in 30 g)

Descrizione

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 -----

Guida contributor