Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using NUnit.Framework;
using Xtensive.Core;
using Xtensive.Collections;
Expand Down Expand Up @@ -931,6 +932,15 @@ public void RemoveTest()

[Test]
public void ReferenceToSessionIsNotPreservedInCacheTest()
{
// Use separate method for session related processing
// to make sure we don't hold session reference somewhere on stack
OpenSessionsAndRunPrefetches();
TestHelper.CollectGarbage(true);
Assert.That(instanceCount, Is.EqualTo(0));
}

private void OpenSessionsAndRunPrefetches()
{
instanceCount = 10;
for (int i = 0; i < instanceCount; i++) {
Expand All @@ -948,8 +958,6 @@ public void ReferenceToSessionIsNotPreservedInCacheTest()
t.Complete();
}
}
TestHelper.CollectGarbage(true);
Assert.That(instanceCount, Is.EqualTo(0));
}

private void PrefetchIntrinsicFields(PrefetchManager prefetchManager, Key key, Type type)
Expand Down