@@ -18,59 +18,43 @@ public static class SqlCommandCancelTest
1818
1919 // Synapse: Remove dependency on Northwind database + WAITFOR not supported + ';' not supported
2020 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
21- public static void PlainCancelTest ( )
22- {
21+ public static void PlainCancelTest_Tcp ( ) =>
2322 PlainCancel ( tcp_connStr ) ;
24- }
2523
2624 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
2725 [ PlatformSpecific ( TestPlatforms . Windows ) ]
28- public static void PlainCancelTestNP ( )
29- {
26+ public static void PlainCancelTest_NamedPipe ( ) =>
3027 PlainCancel ( np_connStr ) ;
31- }
32-
28+
3329 // Synapse: Remove dependency on Northwind database + WAITFOR not supported + ';' not supported
3430 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
35- public static void PlainMARSCancelTest ( )
36- {
31+ public static void PlainCancelTest_TcpMars ( ) =>
3732 PlainCancel ( ( new SqlConnectionStringBuilder ( tcp_connStr ) { MultipleActiveResultSets = true } ) . ConnectionString ) ;
38- }
3933
4034 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
4135 [ PlatformSpecific ( TestPlatforms . Windows ) ]
42- public static void PlainMARSCancelTestNP ( )
43- {
36+ public static void PlainCancelTest_NamedPipeMars ( ) =>
4437 PlainCancel ( ( new SqlConnectionStringBuilder ( np_connStr ) { MultipleActiveResultSets = true } ) . ConnectionString ) ;
45- }
4638
4739 // Synapse: Remove dependency on Northwind database + WAITFOR not supported + ';' not supported
4840 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
49- public static void PlainCancelTestAsync ( )
50- {
41+ public static void PlainCancelTestAsync_Tcp ( ) =>
5142 PlainCancelAsync ( tcp_connStr ) ;
52- }
5343
5444 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
5545 [ PlatformSpecific ( TestPlatforms . Windows ) ]
56- public static void PlainCancelTestAsyncNP ( )
57- {
46+ public static void PlainCancelTestAsync_NamedPipe ( ) =>
5847 PlainCancelAsync ( np_connStr ) ;
59- }
6048
6149 // Synapse: Remove dependency from Northwind database + WAITFOR not supported + ';' not supported.
6250 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
63- public static void PlainMARSCancelTestAsync ( )
64- {
51+ public static void PlainCancelTestAsync_TcpMars ( ) =>
6552 PlainCancelAsync ( ( new SqlConnectionStringBuilder ( tcp_connStr ) { MultipleActiveResultSets = true } ) . ConnectionString ) ;
66- }
6753
6854 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
6955 [ PlatformSpecific ( TestPlatforms . Windows ) ]
70- public static void PlainMARSCancelTestAsyncNP ( )
71- {
56+ public static void PlainCancelTestAsync_NamedPipeMars ( ) =>
7257 PlainCancelAsync ( ( new SqlConnectionStringBuilder ( np_connStr ) { MultipleActiveResultSets = true } ) . ConnectionString ) ;
73- }
7458
7559 private static void PlainCancel ( string connString )
7660 {
@@ -124,126 +108,90 @@ private static void PlainCancelAsync(string connString)
124108
125109 // Synapse: Remove dependency from Northwind database + WAITFOR not supported + ';' not supported.
126110 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
127- public static void MultiThreadedCancel_NonAsync ( )
128- {
111+ public static void MultiThreadedCancel_TcpSync ( ) =>
129112 MultiThreadedCancel ( tcp_connStr , false ) ;
130- }
131113
132114 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
133115 [ PlatformSpecific ( TestPlatforms . Windows ) ]
134- public static void MultiThreadedCancel_NonAsyncNP ( )
135- {
116+ public static void MultiThreadedCancel_NamedPipeSync ( ) =>
136117 MultiThreadedCancel ( np_connStr , false ) ;
137- }
138118
139119 // Synapse: Remove dependency from Northwind database + WAITFOR not supported + ';' not supported.
140120 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
141- public static void MultiThreadedCancel_Async ( )
142- {
121+ public static void MultiThreadedCancel_TcpAsync ( ) =>
143122 MultiThreadedCancel ( tcp_connStr , true ) ;
144- }
145123
146124 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
147125 [ PlatformSpecific ( TestPlatforms . Windows ) ]
148- public static void MultiThreadedCancel_AsyncNP ( )
149- {
126+ public static void MultiThreadedCancel_NamedPipeAsync ( ) =>
150127 MultiThreadedCancel ( np_connStr , true ) ;
151- }
152128
153129 // Synapse: WAITFOR not supported + ';' not supported.
154130 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
155- public static void TimeoutCancelTcp ( )
156- {
131+ public static void TimeoutCancel_Tcp ( ) =>
157132 TimeoutCancel ( tcp_connStr ) ;
158- }
159133
160134 [ ActiveIssue ( "https://github.com/dotnet/SqlClient/issues/3755" ) ]
161135 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
162136 [ PlatformSpecific ( TestPlatforms . Windows ) ]
163- public static void TimeoutCancelNamedPipe ( )
164- {
137+ public static void TimeoutCancel_NamedPipe ( ) =>
165138 TimeoutCancel ( np_connStr ) ;
166- }
167139
168140 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) ) ]
169- public static void CancelAndDisposePreparedCommand ( )
170- {
141+ public static void CancelAndDisposePreparedCommand_Tcp ( ) =>
171142 CancelAndDisposePreparedCommand ( tcp_connStr ) ;
172- }
173143
174144 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
175145 [ PlatformSpecific ( TestPlatforms . Windows ) ]
176- public static void CancelAndDisposePreparedCommandNP ( )
177- {
146+ public static void CancelAndDisposePreparedCommand_NamedPipe ( ) =>
178147 CancelAndDisposePreparedCommand ( np_connStr ) ;
179- }
180148
181149 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) , nameof ( DataTestUtility . IsNotNamedInstance ) ) ]
182- public static void TimeOutDuringReadTcp ( )
183- {
150+ public static void TimeOutDuringRead_Tcp ( ) =>
184151 TimeOutDuringRead ( tcp_connStr ) ;
185- }
186152
187153 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) , nameof ( DataTestUtility . IsNotNamedInstance ) ) ]
188154 [ PlatformSpecific ( TestPlatforms . Windows ) ]
189- public static void TimeOutDuringReadNamedPipe ( )
190- {
155+ public static void TimeOutDuringRead_NamedPipe ( ) =>
191156 TimeOutDuringRead ( np_connStr ) ;
192- }
193157
194158 // Synapse: WAITFOR not supported + ';' not supported.
195159 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
196- public static void CancelDoesNotWait ( )
197- {
160+ public static void CancelDoesNotWait_Tcp ( ) =>
198161 CancelDoesNotWait ( tcp_connStr ) ;
199- }
200162
201163 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
202164 [ PlatformSpecific ( TestPlatforms . Windows ) ]
203- public static void CancelDoesNotWaitNP ( )
204- {
165+ public static void CancelDoesNotWait_NamedPipe ( ) =>
205166 CancelDoesNotWait ( np_connStr ) ;
206- }
207167
208168 // Synapse: WAITFOR not supported + ';' not supported.
209169 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureSynapse ) ) ]
210- public static void AsyncCancelDoesNotWait ( )
211- {
212- AsyncCancelDoesNotWait ( tcp_connStr ) . Wait ( ) ;
213- }
170+ public static Task CancelDoesNotWait_TcpAsync ( ) =>
171+ CancelDoesNotWaitAsync ( tcp_connStr ) ;
214172
215173 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
216174 [ PlatformSpecific ( TestPlatforms . Windows ) ]
217- public static void AsyncCancelDoesNotWaitNP ( )
218- {
219- AsyncCancelDoesNotWait ( np_connStr ) . Wait ( ) ;
220- }
175+ public static Task CancelDoesNotWait_NamedPipeAsync ( ) =>
176+ CancelDoesNotWaitAsync ( np_connStr ) ;
221177
222178 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) ) ]
223- public static void TCPAttentionPacketTestTransaction ( )
224- {
179+ public static void AttentionPacketTestTransaction_Tcp ( ) =>
225180 CancelFollowedByTransaction ( tcp_connStr ) ;
226- }
227181
228182 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
229183 [ PlatformSpecific ( TestPlatforms . Windows ) ]
230- public static void NPAttentionPacketTestTransaction ( )
231- {
184+ public static void AttentionPacketTestTransaction_NamedPipe ( ) =>
232185 CancelFollowedByTransaction ( np_connStr ) ;
233- }
234186
235187 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
236- public static void TCPAttentionPacketTestAlerts ( )
237- {
188+ public static void AttentionPacketTestAlerts_Tcp ( ) =>
238189 CancelFollowedByAlert ( tcp_connStr ) ;
239- }
240190
241191 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) , nameof ( DataTestUtility . IsNotAzureServer ) ) ]
242192 [ PlatformSpecific ( TestPlatforms . Windows ) ]
243- public static void NPAttentionPacketTestAlerts ( )
244- {
193+ public static void AttentionPacketTestAlerts_NamedPipe ( ) =>
245194 CancelFollowedByAlert ( np_connStr ) ;
246- }
247195
248196 private static void CancelFollowedByTransaction ( string constr )
249197 {
@@ -378,7 +326,7 @@ private static void CancelAndDisposePreparedCommand(string constr)
378326 try
379327 {
380328 // Generate a query with a large number of results.
381- using ( var command = new SqlCommand ( "select @P from sysobjects a cross join sysobjects b cross join sysobjects c cross join sysobjects d cross join sysobjects e cross join sysobjects f" , connection ) )
329+ using ( var command = new SqlCommand ( "select @P from sys.objects a cross join sys.objects b cross join sys.objects c cross join sys.objects d cross join sys.objects e cross join sys.objects f" , connection ) )
382330 {
383331 command . Parameters . Add ( new SqlParameter ( "@P" , SqlDbType . Int ) { Value = expectedValue } ) ;
384332 connection . Open ( ) ;
@@ -530,7 +478,7 @@ private static void CancelDoesNotWait(string connStr)
530478 }
531479 }
532480
533- private static async Task AsyncCancelDoesNotWait ( string connStr )
481+ private static async Task CancelDoesNotWaitAsync ( string connStr )
534482 {
535483 const int delaySeconds = 30 ;
536484 const int cancelSeconds = 1 ;
0 commit comments