Skip to content

Commit af10247

Browse files
committed
speed up cancellation tests
1 parent 049ed1a commit af10247

File tree

2 files changed

+3
-3
lines changed
  • tests/GraphQL.Integration.Tests

2 files changed

+3
-3
lines changed

tests/GraphQL.Integration.Tests/QueryAndMutationTests/Base.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ query Long {
168168
}");
169169

170170
using (var setup = WebHostHelpers.SetupTest<StartupChat>(false, serializer)) {
171-
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
171+
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(1));
172172

173173
Func<Task> requestTask = () => setup.Client.SendQueryAsync(graphQLRequest, () => new {longRunning = string.Empty}, cts.Token);
174174
Action timeMeasurement = () => requestTask.Should().Throw<TaskCanceledException>();

tests/GraphQL.Integration.Tests/WebsocketTests/Base.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ public async void CanSendRequestViaWebsocket() {
5252
}
5353

5454
[Fact]
55-
public void PostRequestCanBeCancelled() {
55+
public void WebsocketRequestCanBeCancelled() {
5656
var graphQLRequest = new GraphQLRequest(@"
5757
query Long {
5858
longRunning
5959
}");
6060

6161
using (var setup = WebHostHelpers.SetupTest<StartupChat>(true, Serializer)) {
62-
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
62+
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(1));
6363

6464
Func<Task> requestTask = () => setup.Client.SendQueryAsync(graphQLRequest, () => new { longRunning = string.Empty }, cts.Token);
6565
Action timeMeasurement = () => requestTask.Should().Throw<TaskCanceledException>();

0 commit comments

Comments
 (0)