-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable tests with WaitForPendingFinalizers in gcstress testing #104102
Disable tests with WaitForPendingFinalizers in gcstress testing #104102
Conversation
Some if not all tests from the Methodical suite that use GC.WaitForPendingFinalizers timeout due to the fact that a finalizer of Gen2GcCallback calls a callback that ends up creating another finalizable object that is ready to be finalized. Also a GC memory is allocated in that callback, which triggers the GC stress collection. So the finalization thread keeps finalizing objects on the queue forever and the GC.WaitForPendingFinalizers never exits. This change disables all tests in the Methodical suite that wait for pending finalizers when running with GC stress enabled.
Tagging subscribers to this area: @dotnet/gc |
/azp run runtime-coreclr gcstress0x3-gcstress0xc |
Azure Pipelines successfully started running 1 pipeline(s). |
I think #103738 is a better fix. Perhaps we should review and merge it. I wanted to get it stress-green, at least on runtime stress, but we keep seeing stress issues not related to the PR. I also wanted to be able to run Libraries tests and that is mostly possible, but just like with runtime tests there are few tests that are sensitive to GC stress in some subtle ways (i.e. anything that checks for "reasonable" time spent for something...) and there are some tests (i.e. Dynamic stuff, RegularExpressions,..) that take ridiculously long even with more optimized stress approach. The change allows to run many Libraries tests and thus is very useful for local investigations, but for lab runs we may need to come up with some filtering/excluding mechanism. |
I am wondering if we could provide a better API for this purpose, something like Other than preventing the infinitely locked situation under GCStress, this API will also:
It is just a rough idea, I don't know how feasible that would be yet. |
This looks very much like phantom references (that can be used as finalizer replacement among other things). If we wanted to expose them, I expect that it would be a new type of GC handle at the lowest level. |
I am fine fixing the problem itself instead of disabling tests like this. I just made it as a quick way to make the gcstress legs green again. |
Closing this PR as #103738 has implemented a fix for the issue. |
Some if not all tests from the Methodical suite that use GC.WaitForPendingFinalizers timeout due to the fact that a finalizer of Gen2GcCallback calls a callback that ends up creating another finalizable object that is ready to be finalized. Also a GC memory is allocated in that callback, which triggers the GC stress collection. So the finalization thread keeps finalizing objects on the queue forever and the GC.WaitForPendingFinalizers never exits.
This change disables all tests in the Methodical suite that wait for pending finalizers when running with GC stress enabled.
Closes #104062