File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -566,7 +566,8 @@ public void TransientFault_IgnoreServerProvidedFailoverPartner_ShouldConnectToUs
566566 // Ensure pooling is enabled so that the failover partner information
567567 // is persisted in the pool group. If pooling is disabled, the server
568568 // provided failover partner will never be used.
569- Pooling = true
569+ Pooling = true ,
570+ MinPoolSize = 1
570571 } ;
571572 SqlConnection connection = new ( builder . ConnectionString ) ;
572573
@@ -577,14 +578,17 @@ public void TransientFault_IgnoreServerProvidedFailoverPartner_ShouldConnectToUs
577578 // Close the connection to return it to the pool
578579 connection . Close ( ) ;
579580
580-
581581 // Act
582582 // Dispose of the server to trigger a failover
583583 server . Dispose ( ) ;
584584
585585 // Opening a new connection will use the failover partner stored in the pool group.
586586 // This will fail if the server provided failover partner was stored to the pool group.
587587 using SqlConnection failoverConnection = new ( builder . ConnectionString ) ;
588+
589+ // Clear the pool to ensure a new physical connection is created
590+ // Pool group info such as failover partner will still be retained
591+ SqlConnection . ClearPool ( connection ) ;
588592 failoverConnection . Open ( ) ;
589593
590594 // Assert
You can’t perform that action at this time.
0 commit comments