Skip to content

Commit 8a0830c

Browse files
committed
Update IntegrationTests_Cancellation.cs
1 parent 70aa901 commit 8a0830c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Tests/IntegrationTests/IntegrationTests_Cancellation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public async Task QueryConnection_WithCancelledToken_ThrowsOperationCanceledExce
6060
var executer = new EfDocumentExecuter();
6161

6262
// Create a pre-cancelled token
63-
var cts = new CancellationTokenSource();
64-
cts.Cancel();
63+
var cts = new CancelSource();
64+
await cts.CancelAsync();
6565

6666
var options = new ExecutionOptions
6767
{
@@ -116,7 +116,7 @@ public async Task QueryConnection_WithOperationCancelled_ThrowsOperationCanceled
116116
using var schema = new Schema(provider);
117117
var executer = new EfDocumentExecuter();
118118

119-
var cts = new CancellationTokenSource();
119+
var cts = new CancelSource();
120120

121121
var options = new ExecutionOptions
122122
{
@@ -127,7 +127,7 @@ public async Task QueryConnection_WithOperationCancelled_ThrowsOperationCanceled
127127
};
128128

129129
// Cancel immediately to trigger OperationCanceledException
130-
cts.Cancel();
130+
await cts.CancelAsync();
131131

132132
await Assert.ThrowsAnyAsync<OperationCanceledException>(async () =>
133133
await executer.ExecuteAsync(options));

0 commit comments

Comments
 (0)