File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
NETProvider/src/FirebirdSql.Data.UnitTests Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 23
23
using System . Data ;
24
24
using System . IO ;
25
25
using System . Reflection ;
26
+ using System . Threading ;
26
27
using FirebirdSql . Data . FirebirdClient ;
27
28
using NUnit . Framework ;
28
29
@@ -200,7 +201,7 @@ public void ConnectionPoolingTimeOutTest()
200
201
myConnection2 . Close ( ) ;
201
202
}
202
203
203
- System . Threading . Thread . Sleep ( csb . ConnectionLifeTime * 2 * 1000 ) ;
204
+ Thread . Sleep ( TimeSpan . FromSeconds ( csb . ConnectionLifeTime + 1 ) ) ;
204
205
205
206
Assert . AreEqual ( active , GetActiveConnections ( ) ) ;
206
207
@@ -275,7 +276,7 @@ public void ConnectionPoolingMinPoolSizeTest()
275
276
connections . ForEach ( x => x . Dispose ( ) ) ;
276
277
}
277
278
278
- System . Threading . Thread . Sleep ( csb . ConnectionLifeTime * 2 * 1000 ) ;
279
+ Thread . Sleep ( TimeSpan . FromSeconds ( csb . ConnectionLifeTime + 1 ) ) ;
279
280
280
281
Assert . AreEqual ( active + csb . MinPoolSize , GetActiveConnections ( ) ) ;
281
282
}
Original file line number Diff line number Diff line change @@ -272,11 +272,11 @@ public void DNET595()
272
272
{
273
273
FbConnection . ClearAllPools ( ) ;
274
274
const int NumberOfThreads = 15 ;
275
- const int ConnectionLifeTime = 5 ;
276
275
277
276
FbConnectionStringBuilder csb = BuildConnectionStringBuilder ( this . FbServerType ) ;
278
277
csb . Pooling = true ;
279
- csb . ConnectionLifeTime = ConnectionLifeTime ;
278
+ csb . ConnectionLifeTime = 5 ;
279
+ csb . MinPoolSize = 0 ;
280
280
string cs = csb . ToString ( ) ;
281
281
282
282
var active = GetActiveConnections ( ) ;
@@ -309,7 +309,7 @@ public void DNET595()
309
309
GetSomething ( cs ) ;
310
310
}
311
311
312
- Thread . Sleep ( TimeSpan . FromSeconds ( ConnectionLifeTime + 1 ) ) ;
312
+ Thread . Sleep ( TimeSpan . FromSeconds ( csb . ConnectionLifeTime + 1 ) ) ;
313
313
Assert . AreEqual ( GetActiveConnections ( ) , active ) ;
314
314
}
315
315
You can’t perform that action at this time.
0 commit comments