-
Notifications
You must be signed in to change notification settings - Fork 286
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
VertexBatchTest.Locking failing locally #719
Comments
The specific part of the test that is failing is this: // Make sure that our locks released properly, i.e. allowing the array to be garbage collected
WeakReference weakRefToLockedData = new WeakReference(typedBatch.Vertices.Data);
Assert.IsTrue(weakRefToLockedData.IsAlive);
typedBatch = null;
abstractBatch = null;
GC.Collect();
Assert.IsFalse(weakRefToLockedData.IsAlive); Which is dependent on garbage collection behavior, or more specifically the assumption that |
It does not do it synchronously: Also I think depending on the GC like this is very error prone as it can change between runtime or config settings. |
It is, but since this part of the test is essentially a GC test, I don't really see a way around relying on GC behavior in some way. The current implementation is flaky though.
That's probably the issue then. Could be worth a try to use this overload instead and also wait for pending finalizers afterwards. |
Adjusted the test as described above. @Barsonax Can you check whether the issue is fixed on your machine? |
Will check when iam at my pc |
It did not fix the issue |
Only happens in Debug mode, under release mode the test runs succesfully. Debug seems to be keeping instances alive for longer than needed which makes sense as its handy for debugging. So this error can be fixed by skipping this test in debug mode (no sense in running it if it always fails). In nunit this can be done by making a custom |
* Added a utlity method to properly test if memory is released * added xml docs * moved and renamed garbagecollectiontestset * fix missing include
Fixed in #719 |
Summary
The VertexBatchTest.Locking is failing for me locally
How to reproduce
Workaround
Analysis
The text was updated successfully, but these errors were encountered: