Skip to content

Commit 598d450

Browse files
committed
change test to use loop
1 parent 4f6aa83 commit 598d450

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandCancelTest.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,11 @@ private static async Task ExecuteWaitForAsync(CancellationToken cancellationToke
607607
using (var connection = new SqlConnection(connectionString))
608608
{
609609
await connection.OpenAsync().ConfigureAwait(false);
610-
using (var command = new SqlCommand($"WAITFOR DELAY '00:00:{delaySeconds:D2}'", connection))
610+
using (var command = new SqlCommand(@"
611+
WHILE 1 = 1
612+
BEGIN
613+
DECLARE @x INT = 1
614+
END", connection))
611615
{
612616
command.CommandTimeout = delaySeconds + 10;
613617
await command.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);

0 commit comments

Comments
 (0)