Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

BruceForstall
Copy link

In the test, as written, a GC could sneak in between the GC.KeepAlive()
call and the subsequent line that checks whether the finalizer
has run, especially in GC stress modes. Simply move the GC.KeepAlive()
call down.

In the test, as written, a GC could sneak in between the GC.KeepAlive()
call and the subsequent line that checks whether the finalizer
has run, especially in GC stress modes. Simply move the GC.KeepAlive()
call down.
@BruceForstall
Copy link
Author

Fixes ARM GCStress failures.

@BruceForstall
Copy link
Author

@dotnet-bot test Windows_NT arm Cross Checked gcstress0xc Build and Test

@BruceForstall
Copy link
Author

cc @dotnet/jit-contrib


GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern is known to be flaky. I addressed a few tests that rely on this pattern here: #11216. If this test isn't flaky, I don't think there's any reason to address it here, but as it's written it's possible for the test to fail if we take a really unlucky path through the scheduler.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. No, flakiness isn't the issue I was seeing; it's that the lifetime of tc was simply incorrect.

@BruceForstall BruceForstall merged commit 3d6da79 into dotnet:master Jan 12, 2018
@BruceForstall BruceForstall deleted the FixGCKeepAlive branch January 12, 2018 07:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants