diff options
author | Jon Hanna <jon@hackcraft.net> | 2017-08-04 16:13:00 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2017-08-04 16:13:00 +0300 |
commit | 1cc3cfd75314d707df9f63d80d9f62959c9d86a0 (patch) | |
tree | 8e08b5843027084dea14a4ab2a34e64ee44277a8 /src | |
parent | 247068fbd97c534dc13b3b9d037f67b03dbe57a5 (diff) |
Make ManagedTests.DynamicCSharp…regclass029 test assert finalization (#22914)
#5677 fixed a race in this test that was causing it to sometimes fail
by finalizing too soon, but also moved the assertion of finalization
into the finalizer, so it would only assert that the finalizer had run
if the finalizer had run.
Move the assertion back to the point where the finalizer should be know
to have run, but not in the finalizer itself. (That PR still fixed the
actual race that stopped success being detected).
Diffstat (limited to 'src')
-rw-r--r-- | src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.indexer.regclass.cs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.indexer.regclass.cs b/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.indexer.regclass.cs index fde96f0f3a..854e406785 100644 --- a/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.indexer.regclass.cs +++ b/src/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.indexer.regclass.cs @@ -2238,8 +2238,6 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.context.indexer.regclas memberClassStatus = MemberClass.t_status; } - - Assert.Equal(0, Verify()); } private static int Verify() @@ -2276,8 +2274,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.context.indexer.regclas RequireLifetimesEnded(); GC.Collect(); GC.WaitForPendingFinalizers(); - GC.Collect(); - GC.WaitForPendingFinalizers(); + Assert.Equal(0, Verify()); } } //</Code> |