runtime: Intermittent failure in AddProvider_InvokeTypeMultipleTimes_Refreshes test and AddProviderTransparent_InvokeTypeMultipleTimes_Refreshes
AddProvider_InvokeTypeMultipleTimes_Refreshes test failed in runtime (Libraries Test Run checked coreclr OSX x64 Debug) leg:
Starting: System.ComponentModel.TypeConverter.Tests (parallel test collections = on, max threads = 4)
System.ComponentModel.Tests.TypeDescriptorTests.AddProvider_InvokeTypeMultipleTimes_Refreshes [FAIL]
Assert.Equal() Failure
Expected: 2
Actual: 3
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (17 by maintainers)
That can’t be @stephentoub as he’s not here. I came to the same conclusion, and verified it. I’ll put up a PR.
Yes, my change added a test that triggers a refresh of some static caches. The tests failing sporadically here are subscribing to the static Refreshed event and expecting it to only be called a specific number of times; if the test I added is invoked concurrently with these, these will fail.
The test suite already has: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/src/libraries/System.ComponentModel.TypeConverter/tests/MemberDescriptorTests.cs#L12-L13 The fix then is to add:
to the offending test classes, notably anything that interacts with TypeDescriptor.Refresh/Refreshed.
I can do it if you can wait a couple of weeks until I’m actually back (pretend I’m not here). Feel free to fix it in the interim, of course.