File tree Expand file tree Collapse file tree
Orm/Xtensive.Orm.Tests/Storage/Prefetch Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77using System ;
88using System . Collections . Generic ;
99using System . Linq ;
10+ using System . Threading ;
1011using NUnit . Framework ;
1112using Xtensive . Core ;
1213using Xtensive . Collections ;
@@ -931,6 +932,15 @@ public void RemoveTest()
931932
932933 [ Test ]
933934 public void ReferenceToSessionIsNotPreservedInCacheTest ( )
935+ {
936+ // Use separate method for session related processing
937+ // to make sure we don't hold session reference somewhere on stack
938+ OpenSessionsAndRunPrefetches ( ) ;
939+ TestHelper . CollectGarbage ( true ) ;
940+ Assert . That ( instanceCount , Is . EqualTo ( 0 ) ) ;
941+ }
942+
943+ private void OpenSessionsAndRunPrefetches ( )
934944 {
935945 instanceCount = 10 ;
936946 for ( int i = 0 ; i < instanceCount ; i ++ ) {
@@ -948,8 +958,6 @@ public void ReferenceToSessionIsNotPreservedInCacheTest()
948958 t . Complete ( ) ;
949959 }
950960 }
951- TestHelper . CollectGarbage ( true ) ;
952- Assert . That ( instanceCount , Is . EqualTo ( 0 ) ) ;
953961 }
954962
955963 private void PrefetchIntrinsicFields ( PrefetchManager prefetchManager , Key key , Type type )
You can’t perform that action at this time.
0 commit comments