@@ -28,7 +28,7 @@ public async Task Dispose_WaitsForAllLeases_AndSignalsOnEmptyExactlyOnce()
2828 var opened = new Counter ( ) ;
2929 var closed = new Counter ( ) ;
3030
31- var source = new ImplicitSessionSource ( driver , onEmpty : onEmpty . Inc ) ;
31+ var source = new ImplicitSessionSource ( driver ) ;
3232
3333 using var cts = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
3434 var token = cts . Token ;
@@ -64,7 +64,6 @@ public async Task Dispose_WaitsForAllLeases_AndSignalsOnEmptyExactlyOnce()
6464
6565 Assert . True ( opened . Value > 0 ) ;
6666 Assert . Equal ( opened . Value , closed . Value ) ;
67- Assert . Equal ( 1 , Volatile . Read ( ref onEmpty . Value ) ) ;
6867
6968 await Assert . ThrowsAsync < ObjectDisposedException > ( ( ) => source . OpenSession ( CancellationToken . None ) . AsTask ( ) ) ;
7069 }
@@ -78,7 +77,7 @@ public async Task Stress_Counts_AreBalanced()
7877 var closed = new Counter ( ) ;
7978 var onEmpty = new Counter ( ) ;
8079
81- var source = new ImplicitSessionSource ( driver , onEmpty : onEmpty . Inc ) ;
80+ var source = new ImplicitSessionSource ( driver ) ;
8281
8382 using var cts = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
8483 var token = cts . Token ;
@@ -109,7 +108,6 @@ public async Task Stress_Counts_AreBalanced()
109108 await Task . WhenAll ( workers . Append ( disposer ) ) ;
110109
111110 Assert . Equal ( opened . Value , closed . Value ) ;
112- Assert . Equal ( 1 , onEmpty . Value ) ;
113111 Assert . True ( opened . Value > 0 ) ;
114112
115113 await Assert . ThrowsAsync < ObjectDisposedException > ( ( ) => source . OpenSession ( CancellationToken . None ) . AsTask ( ) ) ;
@@ -121,7 +119,7 @@ public async Task Open_RacingWithDispose_StateRemainsConsistent()
121119 var driver = DummyDriver ( ) ;
122120
123121 var onEmpty = new Counter ( ) ;
124- var source = new ImplicitSessionSource ( driver , onEmpty : onEmpty . Inc ) ;
122+ var source = new ImplicitSessionSource ( driver ) ;
125123
126124 using var cts = new CancellationTokenSource ( TimeSpan . FromSeconds ( 10 ) ) ;
127125 var token = cts . Token ;
@@ -148,8 +146,6 @@ public async Task Open_RacingWithDispose_StateRemainsConsistent()
148146
149147 await Task . WhenAll ( opens . Append ( disposeTask ) ) ;
150148
151- Assert . Equal ( 1 , Volatile . Read ( ref onEmpty . Value ) ) ;
152-
153149 await Assert . ThrowsAsync < ObjectDisposedException > ( ( ) => source . OpenSession ( CancellationToken . None ) . AsTask ( ) ) ;
154150 }
155151}
0 commit comments