1160 references to DefaultTimeout
http2cat (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
IIS.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
IIS.LongTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
InMemory.FunctionalTests (80)
BadHttpRequestTests.cs (1)
271Assert.Empty(await client.Stream.ReadUntilEndAsync().DefaultTimeout());
ConnectionLimitTests.cs (1)
46Assert.True(await lockedTcs.Task.DefaultTimeout());
Http2\Http2ConnectionTests.cs (10)
2006withStreamId: 1).DefaultTimeout(); 2011withStreamId: 1).DefaultTimeout(); 2016withStreamId: 1).DefaultTimeout(); 2021withStreamId: 1).DefaultTimeout(); 2026withStreamId: 1).DefaultTimeout(); 2077withStreamId: 1).DefaultTimeout(); 2084withStreamId: 1).DefaultTimeout(); 2091withStreamId: 1).DefaultTimeout(); 2100withStreamId: 1).DefaultTimeout(); 5676var streamResponse = await tcs.Task.DefaultTimeout();
Http2\Http2KeepAliveTests.cs (16)
41withStreamId: 0).DefaultTimeout(); 70withStreamId: 0).DefaultTimeout(); 90withStreamId: 0).DefaultTimeout(); 129withStreamId: 0).DefaultTimeout(); 153withStreamId: 0).DefaultTimeout(); 162withStreamId: 0).DefaultTimeout(); 171withStreamId: 0).DefaultTimeout(); 194withStreamId: 0).DefaultTimeout(); 204VerifyGoAway(await ReceiveFrameAsync().DefaultTimeout(), 0, Http2ErrorCode.INTERNAL_ERROR); 227withStreamId: 0).DefaultTimeout(); 235withStreamId: 1).DefaultTimeout(); 256withStreamId: 1).DefaultTimeout(); 301withStreamId: 0).DefaultTimeout(); 312withStreamId: 1).DefaultTimeout(); 356withStreamId: 0).DefaultTimeout(); 370withStreamId: 1).DefaultTimeout();
Http2\Http2StreamTests.cs (8)
2998withStreamId: 1).DefaultTimeout(); 3003withStreamId: 1).DefaultTimeout(); 3008withStreamId: 1).DefaultTimeout(); 3021withStreamId: 1).DefaultTimeout(); 3251var readTask = context.Request.Body.ReadAsync(new byte[100], 0, 100).DefaultTimeout(); 3293var read = await context.Request.Body.ReadAsync(new byte[100], 0, 100).DefaultTimeout(); 3294var readTask = context.Request.Body.ReadAsync(new byte[100], 0, 100).DefaultTimeout(); 3460thrownEx = await thrownExTask.DefaultTimeout();
Http2\Http2TestBase.cs (1)
790await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
Http3\Http3StreamTests.cs (1)
2078var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => readTrailersTcs.Task).DefaultTimeout();
HttpsConnectionMiddlewareTests.cs (7)
1105Assert.Equal("HTTP/1.1 200 OK", await reader.ReadLineAsync().DefaultTimeout()); 1106Assert.Equal("Content-Length: 11", await reader.ReadLineAsync().DefaultTimeout()); 1107Assert.Equal("Connection: close", await reader.ReadLineAsync().DefaultTimeout()); 1108Assert.StartsWith("Date: ", await reader.ReadLineAsync().DefaultTimeout()); 1109Assert.Equal("", await reader.ReadLineAsync().DefaultTimeout()); 1110Assert.Equal("hello world", await reader.ReadLineAsync().DefaultTimeout()); 1111Assert.Null(await reader.ReadLineAsync().DefaultTimeout());
HttpsTests.cs (2)
383Assert.Equal(0, await connection.Stream.ReadAsync(new byte[1], 0, 1).DefaultTimeout()); 417Assert.Equal(0, await connection.Stream.ReadAsync(new byte[1], 0, 1).DefaultTimeout());
KestrelMetricsTests.cs (9)
231var notificationFeature = await getNotificationFeatureTcs.Task.DefaultTimeout(); 574responseMessage = await httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 580var notificationFeature = await getNotificationFeatureTcs.Task.DefaultTimeout(); 593await responseStream.ReadUntilEndAsync().DefaultTimeout(); 653responseMessage = await httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 813using var responseMessage = await httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 819var stream = await responseMessage.Content.ReadAsStreamAsync().DefaultTimeout(); 820await Assert.ThrowsAnyAsync<Exception>(() => stream.ReadUntilEndAsync()).DefaultTimeout(); 925await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout();
LoggingConnectionMiddlewareTests.cs (1)
35.DefaultTimeout();
RequestTests.cs (6)
121await context.Request.Body.FillEntireBufferAsync(data, cts.Token).DefaultTimeout(); 187await stream.FillEntireBufferAsync(data).DefaultTimeout(); 925Assert.Equal(0, await httpContext.Request.Body.ReadAsync(new byte[1], 0, 1).DefaultTimeout()); 970var readResult = await httpContext.Request.BodyReader.ReadAsync().AsTask().DefaultTimeout(); 1361await duplexStream.FillEntireBufferAsync(data).DefaultTimeout(); 1798var length = await context.Request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout();
ResponseTests.cs (11)
161var writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 168writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 206await Assert.ThrowsAsync<OperationCanceledException>(() => appTcs.Task).DefaultTimeout(); 703var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => responseWriteTcs.Task).DefaultTimeout(); 781var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => responseWriteTcs.Task).DefaultTimeout(); 819var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => responseWriteTcs.Task).DefaultTimeout(); 861var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => responseWriteTcs.Task).DefaultTimeout(); 2260Assert.Equal(0, await httpContext.Request.Body.ReadAsync(new byte[1], 0, 1).DefaultTimeout()); 2853var closeTask = await closeTaskTcs.Task.DefaultTimeout(); 4714var response = await reader.ReadToEndAsync().DefaultTimeout(); 4757var disposedStatusCode = await disposedTcs.Task.DefaultTimeout();
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
518return task.AsTask().DefaultTimeout();
src\Servers\Kestrel\shared\test\TestApp.cs (2)
22await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout(); 52await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout();
TestTransport\InMemoryHttpClientSlim.cs (1)
96var response = await reader.ReadToEndAsync().DefaultTimeout().ConfigureAwait(false);
UpgradeTests.cs (2)
77var read = await context.Request.Body.ReadAsync(buffer, 0, 128).DefaultTimeout(); 296var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await upgradeTcs.Task).DefaultTimeout();
Interop.FunctionalTests (173)
Http2\Http2RequestTests.cs (5)
72var measurement = await measurementTcs.Task.DefaultTimeout(); 133var protocol = await protocolTcs.Task.DefaultTimeout(); 214var responseMessage = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 279var (readData, trailers) = await longRunningTask.DefaultTimeout(); 298var responseMessage = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
Http2WebSocketInteropTests.cs (2)
75using var host = await hostBuilder.StartAsync().DefaultTimeout(); 134using var host = await hostBuilder.StartAsync().DefaultTimeout();
Http3\Http3RequestTests.cs (55)
153var responseMessage = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 261var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 263await responseStream.ReadAtLeastLengthAsync(TestData.Length, clientBufferSize).DefaultTimeout(); 266await responseStream.ReadAtLeastLengthAsync(TestData.Length, clientBufferSize).DefaultTimeout(); 299var responseTask = client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 301var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 306var response = await responseTask.DefaultTimeout(); 379var responseTask = client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 381var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 387var response = await responseTask.DefaultTimeout(); 405var data = await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 425var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 432var response = await responseTask.DefaultTimeout(); 439var responseText = await response.Content.ReadAsStringAsync().DefaultTimeout(); 469await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 496var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 515await Assert.ThrowsAnyAsync<OperationCanceledException>(() => responseTask).DefaultTimeout(); 519var serverReadTask = await readAsyncTask.Task.DefaultTimeout(); 521var serverEx = await Assert.ThrowsAsync<IOException>(() => serverReadTask).DefaultTimeout(); 567var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 571var ex = await Assert.ThrowsAsync<HttpRequestException>(() => sendTask).DefaultTimeout(); 586var serverReadTask = await readAsyncTask.Task.DefaultTimeout(); 587var serverEx = await Assert.ThrowsAsync<ConnectionAbortedException>(() => serverReadTask).DefaultTimeout(); 636}).DefaultTimeout(); 680var ex = await Assert.ThrowsAnyAsync<HttpRequestException>(() => client.SendAsync(request, CancellationToken.None)).DefaultTimeout(); 695var serverWriteTask = await writeAsyncTask.Task.DefaultTimeout(); 712var data = await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 735var response = await responseTask.DefaultTimeout(); 740var responseText = await response.Content.ReadAsStringAsync().DefaultTimeout(); 1021var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 1029var response = await responseTask.DefaultTimeout(); 1031var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1034var data = await responseStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 1044var serverReadTask = await readAsyncTask.Task.DefaultTimeout(); 1046var serverEx = await Assert.ThrowsAsync<IOException>(() => serverReadTask).DefaultTimeout(); 1118var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 1124var response = await responseTask.DefaultTimeout(); 1125var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1265var response = await responseTask.DefaultTimeout(); 1323var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1325var data = await responseStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 1783var connection = await connectionStartedTcs1.Task.DefaultTimeout(); 1808var response1 = await responseTask1.DefaultTimeout(); 1892var connection = await connectionStartedTcs.Task.DefaultTimeout(); 1901await Assert.ThrowsAsync<HttpRequestException>(() => responseTask).DefaultTimeout(); 2046var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 2053var response = await responseTask.DefaultTimeout(); 2055var httpContext = await requestStartedTcs.Task.DefaultTimeout(); 2070var readTask = await readAsyncTask.Task.DefaultTimeout(); 2074var ex = await Assert.ThrowsAnyAsync<Exception>(() => readTask).DefaultTimeout(); 2146var requestStream = await requestContent.GetStreamAsync().DefaultTimeout(); 2153var response = await responseTask.DefaultTimeout(); 2155var httpContext = await requestStartedTcs.Task.DefaultTimeout(); 2189using var host = await hostBuilder.StartAsync().DefaultTimeout(); 2196var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
Http3\Http3TlsTests.cs (9)
61var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 107var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 149var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 202var ex = await Assert.ThrowsAnyAsync<HttpRequestException>(() => sendTask).DefaultTimeout(); 209using var response = await sendTask.DefaultTimeout(); 211Assert.Equal("True", await response.Content.ReadAsStringAsync().DefaultTimeout()); 248var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 327var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); 492var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
HttpClientHttp2InteropTests.cs (102)
60using var host = await hostBuilder.StartAsync().DefaultTimeout(); 64var response = await client.GetAsync(url).DefaultTimeout(); 84using var host = await hostBuilder.StartAsync().DefaultTimeout(); 92using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 95await BulkContent.VerifyContent(await response.Content.ReadAsStreamAsync().DefaultTimeout()); 123using var host = await hostBuilder.StartAsync().DefaultTimeout(); 137using var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 170using var host = await hostBuilder.StartAsync().DefaultTimeout(); 186using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 189await BulkContent.VerifyContent(await response.Content.ReadAsStreamAsync().DefaultTimeout()); 236read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); 251read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); 290using var host = await hostBuilder.StartAsync().DefaultTimeout(); 299var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 305var stream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 312Assert.Equal(0, await stream.ReadAsync(new byte[10], 0, 10).DefaultTimeout()); 367using var host = await hostBuilder.StartAsync().DefaultTimeout(); 376var responseTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 385Assert.Equal(0, await stream.ReadAsync(new byte[10], 0, 10).DefaultTimeout()); 392var lastData = await lastPacket.Task.DefaultTimeout(); 417var read = await streamReader.ReadToEndAsync().DefaultTimeout(); 426using var host = await hostBuilder.StartAsync().DefaultTimeout(); 436using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 441var read = await response.Content.ReadAsStringAsync().DefaultTimeout(); 447Assert.Equal("Hello World", await clientEcho.Task.DefaultTimeout()); 531using var host = await hostBuilder.StartAsync().DefaultTimeout(); 535var response = await client.GetAsync(url).DefaultTimeout(); 563using var host = await hostBuilder.StartAsync().DefaultTimeout(); 567var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 573var responseBody = await response.Content.ReadAsStringAsync().DefaultTimeout(); 595using var host = await hostBuilder.StartAsync().DefaultTimeout(); 599var exception = await Assert.ThrowsAsync<HttpRequestException>(() => client.GetAsync(url)).DefaultTimeout(); 621using var host = await hostBuilder.StartAsync().DefaultTimeout(); 625var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 628var exception = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync()).DefaultTimeout(); 649using var host = await hostBuilder.StartAsync().DefaultTimeout(); 653var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 655var body = await response.Content.ReadAsStringAsync().DefaultTimeout(); 678using var host = await hostBuilder.StartAsync().DefaultTimeout(); 682var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 685var responseBody = await response.Content.ReadAsStringAsync().DefaultTimeout(); 716var read = await streamReader.ReadToEndAsync().DefaultTimeout(); 725using var host = await hostBuilder.StartAsync().DefaultTimeout(); 735using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 741var responseEx = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync().DefaultTimeout()); 744await Assert.ThrowsAnyAsync<OperationCanceledException>(() => clientEcho.Task.DefaultTimeout()); 775var read = await streamReader.ReadToEndAsync().DefaultTimeout(); 784using var host = await hostBuilder.StartAsync().DefaultTimeout(); 792var requestTask = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 800var responseEx = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync().DefaultTimeout()); 803await Assert.ThrowsAnyAsync<OperationCanceledException>(() => clientEcho.Task.DefaultTimeout()); 825var ex = await Assert.ThrowsAsync<IOException>(() => readTask).DefaultTimeout(); 834using var host = await hostBuilder.StartAsync().DefaultTimeout(); 849await Assert.ThrowsAnyAsync<Exception>(() => requestTask).DefaultTimeout(); 872var ex = await Assert.ThrowsAsync<IOException>(() => readTask).DefaultTimeout(); 881using var host = await hostBuilder.StartAsync().DefaultTimeout(); 894await Assert.ThrowsAnyAsync<Exception>(() => requestTask).DefaultTimeout(); 925using var host = await hostBuilder.StartAsync().DefaultTimeout(); 936await Assert.ThrowsAsync<TaskCanceledException>(() => requestTask).DefaultTimeout(); 966using var host = await hostBuilder.StartAsync().DefaultTimeout(); 972var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 973var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1007using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1013var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 1014var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1050using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1064var response = await requestTask.DefaultTimeout(); 1103using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1108var response = await client.GetAsync(url).DefaultTimeout(); 1159using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1173var response = await requestTask.DefaultTimeout(); 1220using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1229var requestTask = client.GetAsync(url).DefaultTimeout(); 1233var responses = await Task.WhenAll(tasks.ToList()).DefaultTimeout(); 1281using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1290var requestTask = client.PostAsync(url, new StringContent("Hello World")).DefaultTimeout(); 1294var responses = await Task.WhenAll(tasks.ToList()).DefaultTimeout(); 1322using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1327var responseBody = await client.GetStringAsync(url).DefaultTimeout(); 1330var response = await client.PostAsync(url, new ByteArrayContent(new byte[1024 * 18])).DefaultTimeout(); 1355using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1361var responseBody = await client.GetStringAsync(url).DefaultTimeout(); 1370var ex = await Assert.ThrowsAsync<HttpRequestException>(() => client.SendAsync(request).DefaultTimeout()); 1396using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1401var ex = await Assert.ThrowsAsync<HttpRequestException>(() => client.GetAsync(url)).DefaultTimeout(); 1427using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1445var response = await requestTask.DefaultTimeout(); 1476using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1483var response = await requestTask.DefaultTimeout(); 1505read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length).DefaultTimeout(); 1511using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1533var response0 = await requestTask0.DefaultTimeout(); 1534var response1 = await requestTask0.DefaultTimeout(); 1562using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1568var response = await client.SendAsync(request).DefaultTimeout(); 1585using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1590var response = await client.GetAsync(url + " !\"$%&'()*++,-./0123456789:;<>=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~點看").DefaultTimeout(); 1625using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1634var response = await client.GetAsync(url).DefaultTimeout(); 1670using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1679var response = await client.GetAsync(url).DefaultTimeout(); 1727var read = await stream.ReadAsync(responseBuffer, totalRead, responseBuffer.Length - totalRead).DefaultTimeout();
Microsoft.AspNetCore.Components.Server.Tests (14)
Circuits\RemoteJSDataStreamTest.cs (14)
38var success = await RemoteJSDataStream.ReceiveData(_jsRuntime, streamId: unrecognizedGuid, chunkId: 0, chunk, error: null).DefaultTimeout(); 58var success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout(); 86var success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout(); 109var success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk: null, error: "some error").DefaultTimeout(); 128var ex = await Assert.ThrowsAsync<EndOfStreamException>(async () => await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout()); 147var ex = await Assert.ThrowsAsync<EndOfStreamException>(async () => await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout()); 167var ex = await Assert.ThrowsAsync<EndOfStreamException>(async () => await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout()); 191var ex = await Assert.ThrowsAsync<EndOfStreamException>(async () => await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 7, chunk, error: null).DefaultTimeout()); 226var unhandledExceptionResult = await unhandledExceptionRaisedTask.Task.DefaultTimeout(); 237var success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout(); 265var success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 0, chunk, error: null).DefaultTimeout(); 269success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 1, chunk, error: null).DefaultTimeout(); 275var unhandledExceptionResult = await unhandledExceptionRaisedTask.Task.DefaultTimeout(); 286success = await RemoteJSDataStream.ReceiveData(jsRuntime, streamId, chunkId: 2, chunk, error: null).DefaultTimeout();
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
MiddlewareTests.cs (2)
119await Assert.ThrowsAsync<DivideByZeroException>(() => middleware.Invoke(new DefaultHttpContext())).DefaultTimeout(); 164await Assert.ThrowsAsync<DivideByZeroException>(() => middleware.Invoke(context)).DefaultTimeout();
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (10)
ServerStreamingServerCallHandlerTests.cs (9)
66var line1 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 73var line2 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 110var line1 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 114var line2 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 152var line1 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 156var line2 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 193var line = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 247var line1 = await ReadLineAsync(pipe.Reader).DefaultTimeout(); 254var line2 = await ReadLineAsync(pipe.Reader).DefaultTimeout();
UnaryServerCallHandlerTests.cs (1)
1269var value = await tcs.Task.DefaultTimeout();
Microsoft.AspNetCore.Http.Connections.Tests (21)
HttpConnectionDispatcherTests.cs (7)
1577var completedTask = await Task.WhenAny(request1, request2).DefaultTimeout(); 1863await connection.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Unblock")).AsTask().DefaultTimeout(); 1915await connection.Transport.Output.WriteAsync(Encoding.UTF8.GetBytes("Unblock")).AsTask().DefaultTimeout(); 2405var webSocketMessage = await websocketFeature.Client.GetNextMessageAsync().DefaultTimeout(); 2436webSocketMessage = await websocketFeature.Client.GetNextMessageAsync().DefaultTimeout(); 2479var webSocketMessage = await websocketFeature.Client.GetNextMessageAsync().DefaultTimeout(); 2511webSocketMessage = await websocketFeature.Client.GetNextMessageAsync().DefaultTimeout();
LongPollingTests.cs (4)
34await poll.ProcessRequestAsync(context, context.RequestAborted).DefaultTimeout(); 54await poll.ProcessRequestAsync(context, cts.Token).DefaultTimeout(); 78await poll.ProcessRequestAsync(context, context.RequestAborted).DefaultTimeout(); 104await poll.ProcessRequestAsync(context, context.RequestAborted).DefaultTimeout();
MapConnectionHandlerTests.cs (1)
405var result = await client.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), CancellationToken.None).DefaultTimeout();
ServerSentEventsTests.cs (2)
78await task.DefaultTimeout(); 103await task.DefaultTimeout();
WebSocketsTests.cs (7)
164await client.DefaultTimeout(); 189var clientSummary = await client.DefaultTimeout(); 296_ = await client.DefaultTimeout(); 337_ = await client.DefaultTimeout(); 391_ = await client.DefaultTimeout(); 393await transport.DefaultTimeout(); 414var messages = await client.DefaultTimeout();
Microsoft.AspNetCore.InternalTesting.Tests (1)
TaskExtensionsTest.cs (1)
60await Task.FromResult(true).DefaultTimeout();
Microsoft.AspNetCore.RateLimiting.Tests (1)
RateLimitingMiddlewareTests.cs (1)
178await Assert.ThrowsAsync<InvalidOperationException>(() => middleware.Invoke(context)).DefaultTimeout();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (8)
Http2Tests.cs (7)
687Assert.Equal(0, await appResult.Task.DefaultTimeout()); 726Assert.Equal(0, await appResult.Task.DefaultTimeout()); 773Assert.Equal(0, await appResult.Task.DefaultTimeout()); 825Assert.Equal(0, await appResult.Task.DefaultTimeout()); 879Assert.Equal(0, await appResult.Task.DefaultTimeout()); 928Assert.Equal(0, await appResult.Task.DefaultTimeout()); 978Assert.Equal(0, await appResult.Task.DefaultTimeout());
src\Shared\Http2cat\Http2Utilities.cs (1)
405await writableBuffer.FlushAsync().AsTask().DefaultTimeout();
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (3)
DelegateOutOfProcTests.cs (3)
46var deploymentResult = await deployer.DeployAsync().DefaultTimeout(); 49var responseString = await deploymentResult.HttpClient.GetStringAsync("").DefaultTimeout(); 65responseString = await client.GetStringAsync(delegatorAddress).DefaultTimeout();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
MessageBodyTests.cs (1)
350Assert.Equal(5, await readTask.DefaultTimeout());
src\Servers\Kestrel\shared\test\TestApp.cs (2)
22await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout(); 52await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (46)
QuicConnectionContextTests.cs (10)
39await using var serverConnection = await acceptTask.DefaultTimeout(); 63await using var serverConnection = await acceptTask.DefaultTimeout(); 89await using var serverConnection = await acceptTask.DefaultTimeout(); 130await using var serverConnection = await acceptTask.DefaultTimeout(); 138var ex = await Assert.ThrowsAsync<ConnectionResetException>(() => acceptStreamTask.AsTask()).DefaultTimeout(); 222var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 301var ex = await Assert.ThrowsAsync<ConnectionResetException>(() => acceptTask).DefaultTimeout(); 426var ex = await Assert.ThrowsAsync<ConnectionResetException>(() => serverStream.Transport.Input.ReadAsync().AsTask()).DefaultTimeout(); 475var serverEx = await Assert.ThrowsAsync<ConnectionResetException>(() => serverStream.Transport.Input.ReadAsync().AsTask()).DefaultTimeout(); 487var clientEx = await Assert.ThrowsAsync<QuicException>(() => clientStream.ReadAsync(buffer).AsTask()).DefaultTimeout();
QuicConnectionListenerTests.cs (10)
56var serverConnection = await acceptTask.DefaultTimeout(); 77var serverConnection1 = await acceptTask1.DefaultTimeout(); 94var serverFailureLog = await serverFailureLogTask.DefaultTimeout(); 102var serverConnection2 = await acceptTask2.DefaultTimeout(); 126var serverStreamTask = serverConnection.AcceptAsync().DefaultTimeout(); 133var serverStream = await serverStreamTask.DefaultTimeout(); 204Assert.Null(await acceptTask.AsTask().DefaultTimeout()); 222Assert.Null(await acceptTask.AsTask().DefaultTimeout()); 257var ex = await Assert.ThrowsAsync<AuthenticationException>(() => QuicConnection.ConnectAsync(options).AsTask()).DefaultTimeout(); 404await Assert.ThrowsAsync<AuthenticationException>(() => clientConnectionTask.AsTask()).DefaultTimeout();
QuicStreamContextTests.cs (10)
136await readTask.DefaultTimeout(); 207var data = await readingTask.DefaultTimeout(); 275var ex = await Assert.ThrowsAsync<ConnectionResetException>(() => serverStream.Transport.Input.ReadAsync().AsTask()).DefaultTimeout(); 353var ex = await Assert.ThrowsAsync<ConnectionResetException>(() => serverStream.Transport.Input.ReadAsync().AsTask()).DefaultTimeout(); 417var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 458var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 466var ex = await Assert.ThrowsAsync<QuicException>(() => clientStream.ReadAsync(new byte[1024]).AsTask()).DefaultTimeout(); 517var data = await clientStream.ReadUntilEndAsync().DefaultTimeout(); 521var clientEx = await Assert.ThrowsAsync<QuicException>(() => clientStream.WriteAsync(data).AsTask()).DefaultTimeout(); 526var serverEx = await Assert.ThrowsAsync<ConnectionAbortedException>(() => serverReadTask).DefaultTimeout();
QuicTransportFactoryTests.cs (3)
32var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => quicTransportFactory.BindAsync(new IPEndPoint(0, 0), features: null, cancellationToken: CancellationToken.None).AsTask()).DefaultTimeout(); 49var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => quicTransportFactory.BindAsync(new IPEndPoint(0, 0), features: features, cancellationToken: CancellationToken.None).AsTask()).DefaultTimeout(); 72await quicTransportFactory.BindAsync(new IPEndPoint(0, 0), features: features, cancellationToken: CancellationToken.None).AsTask().DefaultTimeout();
WebHostTests.cs (13)
248var response1 = await client.SendAsync(request1).DefaultTimeout(); 253var responseText1 = await response1.Content.ReadAsStringAsync().DefaultTimeout(); 262var response2 = await client.SendAsync(request2).DefaultTimeout(); 267var responseText2 = await response2.Content.ReadAsStringAsync().DefaultTimeout(); 319var response1 = await client.SendAsync(request1).DefaultTimeout(); 324var responseText1 = await response1.Content.ReadAsStringAsync().DefaultTimeout(); 332var response2 = await client.SendAsync(request2).DefaultTimeout(); 337var responseText2 = await response2.Content.ReadAsStringAsync().DefaultTimeout(); 357var response1 = await client.SendAsync(request1).DefaultTimeout(); 362var responseText1 = await response1.Content.ReadAsStringAsync().DefaultTimeout(); 369var response2 = await client.SendAsync(request2).DefaultTimeout(); 374var responseText2 = await response2.Content.ReadAsStringAsync().DefaultTimeout(); 409var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => host.StartAsync()).DefaultTimeout();
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (104)
HubConnectionTests.cs (86)
106var result = await connection.InvokeAsync<string>(nameof(TestHub.HelloWorld)).DefaultTimeout(); 143var ex = await Assert.ThrowsAnyAsync<Exception>(() => connection.StartAsync()).DefaultTimeout(); 200var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 228var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), null).DefaultTimeout(); 257var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 261result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 290var connectionIdFromServer = await connection.InvokeAsync<string>(nameof(TestHub.GetCallerConnectionId)).DefaultTimeout(); 295connectionIdFromServer = await connection.InvokeAsync<string>(nameof(TestHub.GetCallerConnectionId)).DefaultTimeout(); 348var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 358result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 387var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo).ToLowerInvariant(), originalMessage).DefaultTimeout(); 423helloWorldTcs.SetResult(await connection.InvokeAsync<string>(nameof(TestHub.HelloWorld)).DefaultTimeout()); 428Assert.Equal(originalMessage, await echoTcs.Task.DefaultTimeout()); 429Assert.Equal("Hello World!", await helloWorldTcs.Task.DefaultTimeout()); 700Assert.Equal(originalMessage, await tcs.Task.DefaultTimeout()); 769var channel = await connection.StreamAsChannelAsync<int>("Stream", 5).DefaultTimeout(); 770var results = await channel.ReadAndCollectAllAsync().DefaultTimeout(); 800var channel = await connection.StreamAsChannelAsync<string>("StreamEcho", channelWriter.Reader).DefaultTimeout(); 803Assert.Equal("1", await channel.ReadAsync().AsTask().DefaultTimeout()); 805Assert.Equal("2", await channel.ReadAsync().AsTask().DefaultTimeout()); 808var results = await channel.ReadAndCollectAllAsync().DefaultTimeout(); 848var channel = await connection.StreamAsChannelAsync<string>("StreamEcho", stream).DefaultTimeout(); 850Assert.Equal("A", await channel.ReadAsync().AsTask().DefaultTimeout()); 851Assert.Equal("B", await channel.ReadAsync().AsTask().DefaultTimeout()); 852Assert.Equal("C", await channel.ReadAsync().AsTask().DefaultTimeout()); 853Assert.Equal("D", await channel.ReadAsync().AsTask().DefaultTimeout()); 855var results = await channel.ReadAndCollectAllAsync().DefaultTimeout(); 896var channel = await connection.StreamAsChannelAsync<int>("StreamEchoInt", stream, cts.Token).DefaultTimeout(); 979var channel = await connection.StreamAsChannelAsync<int>("Stream", 1000, cts.Token).DefaultTimeout(); 982await channel.WaitToReadAsync().AsTask().DefaultTimeout(); 986var results = await channel.ReadAndCollectAllAsync(suppressExceptions: true).DefaultTimeout(); 1021await Assert.ThrowsAnyAsync<OperationCanceledException>(() => connection.StreamAsChannelAsync<int>("Stream", 5, cts.Token).DefaultTimeout()); 1052var channel = await connection.StreamAsChannelAsync<int>("StreamException").DefaultTimeout(); 1054var ex = await Assert.ThrowsAsync<HubException>(() => channel.ReadAndCollectAllAsync().DefaultTimeout()); 1081var ex = await Assert.ThrowsAsync<HubException>(() => connection.InvokeAsync("!@#$%")).DefaultTimeout(); 1108var ex = await Assert.ThrowsAsync<HubException>(() => connection.InvokeAsync("!@#$%", 10, "test")).DefaultTimeout(); 1135var ex = await Assert.ThrowsAsync<HubException>(() => connection.InvokeAsync("Echo", "p1", 42)).DefaultTimeout(); 1162var ex = await Assert.ThrowsAsync<HubException>(() => connection.InvokeAsync("Echo", new[] { 42 })).DefaultTimeout(); 1190var ex = await Assert.ThrowsAsync<HubException>(() => channel.ReadAndCollectAllAsync().DefaultTimeout()); 1218var ex = await Assert.ThrowsAsync<HubException>(() => channel.ReadAndCollectAllAsync().DefaultTimeout()); 1246var ex = await Assert.ThrowsAsync<HubException>(() => channel.ReadAndCollectAllAsync().DefaultTimeout()); 1272var channel = await connection.StreamAsChannelAsync<int>("HelloWorld").DefaultTimeout(); 1273var ex = await Assert.ThrowsAsync<HubException>(() => channel.ReadAndCollectAllAsync()).DefaultTimeout(); 1300var ex = await Assert.ThrowsAsync<HubException>(() => connection.InvokeAsync("Stream", 3)).DefaultTimeout(); 1326var channel = await connection.StreamAsChannelAsync<int>("StreamBroken").DefaultTimeout(); 1327var ex = await Assert.ThrowsAsync<HubException>(() => channel.ReadAndCollectAllAsync()).DefaultTimeout(); 1372var exception = await closedTcs.Task.DefaultTimeout(); 1375var hubException = await Assert.ThrowsAsync<HubException>(() => result).DefaultTimeout(); 1423var result = connection.InvokeAsync<string>(nameof(TestHub.GetUnserializableObject)).DefaultTimeout(); 1426var exception = await closedTcs.Task.DefaultTimeout(); 1429var hubException = await Assert.ThrowsAsync<HubException>(() => result).DefaultTimeout(); 1463var hubException = await Assert.ThrowsAsync<HubException>(() => connection.InvokeAsync<int>("StreamEcho", new List<string> { "1", "2" }).DefaultTimeout()); 1493var message = await hubConnection.InvokeAsync<string>(nameof(TestHub.Echo), "Hello, World!").DefaultTimeout(); 1548var message = await hubConnection.InvokeAsync<string>(nameof(TestHub.Echo), "Hello, World!").DefaultTimeout(); 1580var headerValues = await hubConnection.InvokeAsync<string[]>(nameof(TestHub.GetHeaderValues), new[] { "X-test", "X-42" }).DefaultTimeout(); 1611var headerValues = await hubConnection.InvokeAsync<string[]>(nameof(TestHub.GetHeaderValues), new[] { "User-Agent" }).DefaultTimeout(); 1652var headerValues = await hubConnection.InvokeAsync<string[]>(nameof(TestHub.GetHeaderValues), new[] { "User-Agent" }).DefaultTimeout(); 1687var headerValues = await hubConnection.InvokeAsync<string[]>(nameof(TestHub.GetHeaderValues), new[] { "User-Agent" }).DefaultTimeout(); 1727var cookieValue = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetCookieValue), "Foo").DefaultTimeout(); 1778var echoResponse = await hubConnection.InvokeAsync<string>(nameof(TestHub.Echo), "Foo").DefaultTimeout(); 1837var echoResponse = await hubConnection.InvokeAsync<string>(nameof(HubWithAuthorization2.Echo), "Foo").DefaultTimeout(); 1944var headerResponse = await hubConnection.InvokeAsync<string[]>(nameof(TestHub.GetHeaderValues), new string[] { "Authorization" }).DefaultTimeout(); 1980var cookieValue = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetCookieValue), "fromNegotiate").DefaultTimeout(); 2008var features = await hubConnection.InvokeAsync<JsonElement[]>(nameof(TestHub.GetIHttpConnectionFeatureProperties)).DefaultTimeout(); 2047var userIdentifier = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetUserIdentifier)).DefaultTimeout(); 2077var transport = await hubConnection.InvokeAsync<HttpTransportType>(nameof(TestHub.GetActiveTransportName)).DefaultTimeout(); 2122await pollTracker.ActivePoll.DefaultTimeout(); 2176var newConnectionId = await reconnectedTcs.Task.DefaultTimeout(); 2180var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), echoMessage).DefaultTimeout(); 2236var newConnectionId = await reconnectedTcs.Task.DefaultTimeout(); 2240var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), echoMessage).DefaultTimeout(); 2302var newConnectionId = await reconnectedTcs.Task.DefaultTimeout(); 2306var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), echoMessage).DefaultTimeout(); 2388var httpProtocol = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetHttpProtocol)).DefaultTimeout(); 2441var httpProtocol = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetHttpProtocol)).DefaultTimeout(); 2484var httpProtocol = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetHttpProtocol)).DefaultTimeout(); 2534var httpProtocol = await hubConnection.InvokeAsync<string>(nameof(TestHub.GetHttpProtocol)).DefaultTimeout(); 2582var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 2590var resultTask = connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 2650var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 2660result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 2787Assert.Null(await closedTcs.Task.DefaultTimeout()); 2823var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), new string('x', 500)).DefaultTimeout(); 2825var resultTask = connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 2893var result = await connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout(); 2901var resultTask = connection.InvokeAsync<string>(nameof(TestHub.Echo), originalMessage).DefaultTimeout();
HubConnectionTests.Tracing.cs (15)
81var resultTask = connection.InvokeAsync<string>(nameof(TestHub.HelloWorld)).DefaultTimeout(); 110var result = await resultTask.DefaultTimeout(); 138var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 4).DefaultTimeout(); 277clientActivity = await clientActivityTcs.Task.DefaultTimeout(); 310var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 439var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 440var clientActivity = await clientActivityTcs.Task.DefaultTimeout(); 536var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 537var clientActivity = await clientActivityTcs.Task.DefaultTimeout(); 609async () => await connection.InvokeAsync<string>(nameof(TestHub.InvokeException))).DefaultTimeout(); 631var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 632var clientActivity = await clientActivityTcs.Task.DefaultTimeout(); 708await echoTcs.Task.DefaultTimeout(); 730var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 731var clientActivity = await clientActivityTcs.Task.DefaultTimeout();
HubProtocolVersionTests.cs (3)
51var result = await connection.InvokeAsync<string>(nameof(VersionHub.Echo), "Hello World!").DefaultTimeout(); 84var result = await connection.InvokeAsync<string>(nameof(VersionHub.Echo), "Hello World!").DefaultTimeout(); 183"Unable to complete handshake with the server due to an error: The server does not support version 2147483647 of the 'json' protocol.").DefaultTimeout();
Microsoft.AspNetCore.SignalR.Client.Tests (155)
HttpConnectionTests.ConnectionLifecycle.cs (6)
70async () => await connection.StartAsync()).DefaultTimeout(); 157var ex = await Assert.ThrowsAsync<AggregateException>(() => connection.StartAsync()).DefaultTimeout(); 422await Assert.ThrowsAsync<TaskCanceledException>(() => startTask).DefaultTimeout(); 447var ex = await Assert.ThrowsAsync<AggregateException>(async () => await connection.StartAsync(cts.Token)).DefaultTimeout(); 473await Assert.ThrowsAsync<TaskCanceledException>(async () => await connection.StartAsync(new CancellationToken(canceled: true))).DefaultTimeout(); 504var ex = await Assert.ThrowsAsync<AggregateException>(async () => await connection.StartAsync()).DefaultTimeout();
HttpConnectionTests.cs (1)
202var headerWasFound = await negotiateUrlTcs.Task.DefaultTimeout();
HttpConnectionTests.Negotiate.cs (1)
90Assert.Equal(expectedNegotiate, await negotiateUrlTcs.Task.DefaultTimeout());
HttpConnectionTests.Transport.cs (1)
248Assert.Equal(data, await sendTcs.Task.DefaultTimeout());
HubConnectionTests.ConnectionLifecycle.cs (11)
73await Assert.ThrowsAsync<InvalidOperationException>(() => secondStart).DefaultTimeout(); 199var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => method(connection)).DefaultTimeout(); 377var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => connection.SendAsync("Foo")).DefaultTimeout(); 412var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => connection.SendAsync("Foo")).DefaultTimeout(); 450var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => connection.SendAsync("Foo")).DefaultTimeout(); 480var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => targetTask).DefaultTimeout(); 516await Assert.ThrowsAnyAsync<OperationCanceledException>(() => hubConnection.StartAsync()).DefaultTimeout(); 543await Assert.ThrowsAsync<TaskCanceledException>(() => hubConnection.StartAsync(new CancellationToken(canceled: true))).DefaultTimeout(); 590await connection.ReadSentTextMessageAsync().DefaultTimeout(); 594await Assert.ThrowsAnyAsync<OperationCanceledException>(() => startTask).DefaultTimeout(); 629var exception = await closedEventTcs.Task.DefaultTimeout();
HubConnectionTests.cs (37)
40await Assert.ThrowsAsync<InvalidOperationException>(async () => await hubConnection.InvokeAsync<int>("test").DefaultTimeout()); 134var invokeTask = hubConnection.InvokeAsync<int>("testMethod").DefaultTimeout(); 156var invokeTask = hubConnection.InvokeAsync<int>("testMethod").DefaultTimeout(); 175var invokeTask = hubConnection.InvokeAsync<int>("testMethod", cancellationToken: cts.Token).DefaultTimeout(); 192hubConnection.InvokeAsync<int>("testMethod", cancellationToken: new CancellationToken(canceled: true)).DefaultTimeout()); 197Assert.Equal("{\"type\":7}", await connection.ReadSentTextMessageAsync().DefaultTimeout()); 216Assert.Equal("{\"type\":7}", await connection.ReadSentTextMessageAsync().DefaultTimeout()); 253hubConnection.StreamAsChannelAsync<int>("testMethod", cancellationToken: new CancellationToken(canceled: true)).DefaultTimeout()); 258Assert.Equal("{\"type\":7}", await connection.ReadSentTextMessageAsync().DefaultTimeout()); 277Assert.Equal("{\"type\":7}", await connection.ReadSentTextMessageAsync().DefaultTimeout()); 296var item = await connection.ReadSentJsonAsync().DefaultTimeout(); 327var item = await connection.ReadSentJsonAsync().DefaultTimeout(); 336item = await connection.ReadSentJsonAsync().DefaultTimeout(); 341await Assert.ThrowsAsync<TaskCanceledException>(async () => await e.MoveNextAsync()).DefaultTimeout(); 367var exception = Assert.IsType<TimeoutException>(await closeTcs.Task.DefaultTimeout()); 441var invocation = await connection.ReadSentJsonAsync().DefaultTimeout(); 450var item = await connection.ReadSentJsonAsync().DefaultTimeout(); 457var completion = await connection.ReadSentJsonAsync().DefaultTimeout(); 463var result = await invokeTask.DefaultTimeout(); 481var invocation = await connection.ReadSentJsonAsync().DefaultTimeout(); 491var received = await connection.ReadSentJsonAsync().DefaultTimeout(); 512var invocation = await connection.ReadSentJsonAsync().DefaultTimeout(); 522var received = await connection.ReadSentJsonAsync().DefaultTimeout(); 529var completion = await connection.ReadSentJsonAsync().DefaultTimeout(); 536var result = await invokeTask.DefaultTimeout(); 557var invokeMessage = await connection.ReadSentJsonAsync().DefaultTimeout(); 569var complete = await connection.ReadSentJsonAsync().DefaultTimeout(); 589var invokeMessage = await connection.ReadSentJsonAsync().DefaultTimeout(); 595var complete = await connection.ReadSentJsonAsync().DefaultTimeout(); 614var invokeMessage = await connection.ReadSentJsonAsync().DefaultTimeout(); 629await Assert.ThrowsAsync<TaskCanceledException>(() => invokeTask).DefaultTimeout(); 647var invocation = await connection.ReadSentJsonAsync().DefaultTimeout(); 653var result = await invokeTask.DefaultTimeout(); 716await hubConnection.InvokeAsync<string>("Echo", msg).DefaultTimeout(); 738await connection.ReadSentJsonAsync().DefaultTimeout(); 908var exception = await closedEventTcs.Task.DefaultTimeout(); 940var exception = await closedEventTcs.Task.DefaultTimeout();
HubConnectionTests.Extensions.cs (6)
233await handlerTcs.Task.DefaultTimeout(); 271Assert.Equal(42, await receiveTcs.Task.DefaultTimeout()); 313Assert.Equal(42, await receiveTcs.Task.DefaultTimeout()); 351Assert.Equal(42, await receiveTcs.Task.DefaultTimeout()); 393Assert.Equal(42, await receiveTcs.Task.DefaultTimeout()); 693await handlerTcs.Task.DefaultTimeout();
HubConnectionTests.Protocol.cs (38)
28var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 52var handshakeMessage = await connection.ReadHandshakeAndSendResponseAsync().DefaultTimeout(); 78await connection.ReadSentTextMessageAsync().DefaultTimeout(); 83var ex = await Assert.ThrowsAsync<InvalidDataException>(() => startTask).DefaultTimeout(); 106var message = await connection.ReadHandshakeAndSendResponseAsync(56).DefaultTimeout(); 128var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 161var closeException = await closedTcs.Task.DefaultTimeout(); 190var closeException = await closedTcs.Task.DefaultTimeout(); 209var channel = await hubConnection.StreamAsChannelAsync<object>("Foo").DefaultTimeout(); 211var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 258var channel = await hubConnection.StreamAsChannelAsync<int>("Foo").DefaultTimeout(); 262Assert.Empty(await channel.ReadAndCollectAllAsync().DefaultTimeout()); 284Assert.Equal(42, await invokeTask.DefaultTimeout()); 306var ex = await Assert.ThrowsAsync<HubException>(() => invokeTask).DefaultTimeout(); 325var channel = await hubConnection.StreamAsChannelAsync<string>("Foo").DefaultTimeout(); 329var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => channel.ReadAndCollectAllAsync()).DefaultTimeout(); 348var channel = await hubConnection.StreamAsChannelAsync<int>("Foo").DefaultTimeout(); 352var ex = await Assert.ThrowsAsync<HubException>(async () => await channel.ReadAndCollectAllAsync()).DefaultTimeout(); 375var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => invokeTask).DefaultTimeout(); 394var channel = await hubConnection.StreamAsChannelAsync<string>("Foo").DefaultTimeout(); 401var notifications = await channel.ReadAndCollectAllAsync().DefaultTimeout(); 427Assert.Equal(args, await handlerCalled.Task.DefaultTimeout()); 456var ex = Assert.ThrowsAsync<TimeoutException>(async () => await handlerTask.DefaultTimeout(2000)); 490var ex = Assert.ThrowsAsync<TimeoutException>(async () => await handlerTask.DefaultTimeout(2000)); 577var response = await tcs.Task.DefaultTimeout(); 612var response = await tcs.Task.DefaultTimeout(); 636var firstPing = await connection.ReadSentTextMessageAsync(ignorePings: false).DefaultTimeout(); 639var secondPing = await connection.ReadSentTextMessageAsync(ignorePings: false).DefaultTimeout(); 667var messages = await connection.ReadAllSentMessagesAsync(ignorePings: false).DefaultTimeout(); 691var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 738var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 766var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 795var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 817var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 842var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 867var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 892var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout(); 923var invokeMessage = await connection.ReadSentTextMessageAsync().DefaultTimeout();
HubConnectionTests.Reconnect.cs (34)
64Assert.Same(exception, await closedErrorTcs.Task.DefaultTimeout()); 158Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 167Assert.Same(reconnectedConnectionId, await reconnectedConnectionIdTcs.Task.DefaultTimeout()); 176var closeError = await closedErrorTcs.Task.DefaultTimeout(); 255Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 264var closeError = await closedErrorTcs.Task.DefaultTimeout(); 350Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 355var closeError = await closedErrorTcs.Task.DefaultTimeout(); 432Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 438await reconnectedConnectionIdTcs.Task.DefaultTimeout(); 450Assert.Same(secondException, await reconnectingErrorTcs.Task.DefaultTimeout()); 456await reconnectedConnectionIdTcs.Task.DefaultTimeout(); 464var closeError = await closedErrorTcs.Task.DefaultTimeout(); 535var reconnectingException = await reconnectingErrorTcs.Task.DefaultTimeout(); 544await reconnectedConnectionIdTcs.Task.DefaultTimeout(); 548var closeError = await closedErrorTcs.Task.DefaultTimeout(); 609var closeError = await closedErrorTcs.Task.DefaultTimeout(); 664await closedErrorTcs.Task.DefaultTimeout(); 719Assert.Same(firstException, await Assert.ThrowsAsync<Exception>(() => startTask).DefaultTimeout()); 792await currentTestConnection.ReadHandshakeAndSendResponseAsync().DefaultTimeout(); 799Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 817await currentTestConnection.ReadHandshakeAndSendResponseAsync().DefaultTimeout(); 818await reconnectedConnectionIdTcs.Task.DefaultTimeout(); 826var closeError = await closedErrorTcs.Task.DefaultTimeout(); 899await currentTestConnection.ReadHandshakeAndSendResponseAsync().DefaultTimeout(); 906Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 914await currentTestConnection.ReadSentTextMessageAsync().DefaultTimeout(); 937await currentTestConnection.ReadHandshakeAndSendResponseAsync().DefaultTimeout(); 938await reconnectedConnectionIdTcs.Task.DefaultTimeout(); 946var closeError = await closedErrorTcs.Task.DefaultTimeout(); 1026Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 1036Assert.IsType<OperationCanceledException>(await closedErrorTcs.Task.DefaultTimeout()); 1103Assert.Same(firstException, await reconnectingErrorTcs.Task.DefaultTimeout()); 1111Assert.IsType<OperationCanceledException>(await closedErrorTcs.Task.DefaultTimeout());
HubConnectionTests.Tracing.cs (7)
43var invokeMessage = await connection.ReadSentJsonAsync().DefaultTimeout(); 78var channel = await hubConnection.StreamAsChannelAsync<object>("Foo").DefaultTimeout(); 80var invokeMessage = await connection.ReadSentJsonAsync().DefaultTimeout(); 118var invokeMessage = await connection.ReadSentJsonAsync().DefaultTimeout(); 157await connection.ReadSentJsonAsync().DefaultTimeout(); 196var clientActivity = await clientActivityTcs.Task.DefaultTimeout(); 206await connection.ReadSentJsonAsync().DefaultTimeout();
LongPollingTransportTests.cs (6)
143var data = await longPollingTransport.Input.ReadAllAsync().DefaultTimeout(); 309var exception = await Assert.ThrowsAsync<HttpRequestException>(async () => await longPollingTransport.Input.ReadAllAsync().DefaultTimeout()); 355await longPollingTransport.Input.ReadAllAsync().DefaultTimeout(); 388await longPollingTransport.Input.ReadAllAsync().DefaultTimeout(); 670var completedTask = await Task.WhenAny(completionTcs.Task, longPollingTransport.Running).DefaultTimeout(); 748var response = await responseTaskCompletionSource.Task.DefaultTimeout();
SendUtilsTests.cs (1)
46var response = await responseTaskCompletionSource.Task.DefaultTimeout();
ServerSentEventsTransportTests.cs (6)
107var message = await sseTransport.Input.ReadSingleAsync().DefaultTimeout(); 155await sseTransport.Input.ReadAllAsync().DefaultTimeout(); 214var exception = await Assert.ThrowsAsync<HttpRequestException>(() => sseTransport.Input.ReadAllAsync().DefaultTimeout()); 288var message = await sseTransport.Input.ReadSingleAsync().DefaultTimeout(); 437var response = await responseTaskCompletionSource.Task.DefaultTimeout(); 489var message = await sseTransport.Input.ReadAllAsync().DefaultTimeout();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (12)
RedisEndToEnd.cs (10)
49var str = await connection.InvokeAsync<string>("Echo", "Hello, World!").DefaultTimeout(); 82Assert.Equal("Hello, World!", await tcs.Task.DefaultTimeout()); 83Assert.Equal("Hello, World!", await tcs2.Task.DefaultTimeout()); 110Assert.Equal("Hello, World!", await tcs.Task.DefaultTimeout()); 111Assert.Equal("Hello, World!", await tcs2.Task.DefaultTimeout()); 141Assert.Equal("Hello, World!", await tcs.Task.DefaultTimeout()); 172Assert.Equal("Hello, World!", await tcs2.Task.DefaultTimeout()); 176Assert.Equal("Hello, World!", await tcs.Task.DefaultTimeout()); 204Assert.Equal("Hello, World!", await tcs2.Task.DefaultTimeout()); 208Assert.Equal("Hello, World!", await tcs.Task.DefaultTimeout());
RedisHubLifetimeManagerTests.cs (2)
72var message = Assert.IsType<InvocationMessage>(await client2.ReadAsync().DefaultTimeout()); 116var ex = await Assert.ThrowsAsync<ApplicationException>(() => manager.OnConnectedAsync(connection)).DefaultTimeout();
Microsoft.AspNetCore.SignalR.Tests (475)
ClientProxyTests.cs (1)
216var ex = await Assert.ThrowsAsync<NotImplementedException>(async () => await proxy.InvokeAsync<int>("method", cancellationToken: default)).DefaultTimeout();
EndToEndTests.cs (6)
108var result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout(); 116result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout(); 147var result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout(); 155result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout(); 293Assert.Equal(message, Encoding.UTF8.GetString(await connection.Transport.Input.ReadAsync(bytes.Length).DefaultTimeout())); 344var receivedData = await connection.Transport.Input.ReadAsync(bytes.Length).DefaultTimeout();
HubConnectionHandlerTests.Activity.cs (21)
52var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 57await client.SendInvocationAsync(nameof(MethodHub.Echo), "test").DefaultTimeout(); 59var completionMessage = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 66await client.SendInvocationAsync("RenamedMethod").DefaultTimeout(); 67Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 72await client.SendInvocationAsync(nameof(MethodHub.ActivityMethod)).DefaultTimeout(); 73Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 127var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 139await client.SendInvocationAsync(nameof(MethodHub.Echo), headers, "test").DefaultTimeout(); 141var completionMessage = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 198var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 203_ = await client.StreamAsync(nameof(StreamingHub.CounterChannel), 3).DefaultTimeout(); 208_ = await client.StreamAsync("RenamedCounterChannel", 3).DefaultTimeout(); 257var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 269_ = await client.StreamAsync(nameof(StreamingHub.CounterChannel), streamIds: null, headers: headers, 3).DefaultTimeout(); 328var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 375var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 427var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 429_ = await client.StreamAsync(nameof(StreamingHub.ExceptionAsyncEnumerable)).DefaultTimeout(); 478var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 480_ = await client.InvokeAsync(nameof(MethodHub.MethodThatThrows)).DefaultTimeout();
HubConnectionHandlerTests.ClientResult.cs (67)
23var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 25var invocationId = await client.SendHubMessageAsync(new InvocationMessage("1", nameof(MethodHub.GetClientResult), new object[] { 5 })).DefaultTimeout(); 28var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 31await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 33var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 56var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 58var invocationId = await client.SendHubMessageAsync(new InvocationMessage("1", nameof(MethodHub.GetClientResult), new object[] { 5 })).DefaultTimeout(); 61var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 63await client.SendHubMessageAsync(CompletionMessage.WithError(invocationMessage.InvocationId, "Client error")).DefaultTimeout(); 65var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 88var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 91var closeMessage = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 115var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 119var closeMessage = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 122var ex = await Assert.ThrowsAsync<IOException>(() => connectionHandlerTask).DefaultTimeout(); 148var message = await client.ReadAsync().DefaultTimeout(); 155await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 157var result = await resultTask.DefaultTimeout(); 182var message = await client.ReadAsync().DefaultTimeout(); 189await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 191var result = await resultTask.DefaultTimeout(); 206var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 211new object[] { 7, 3 })).DefaultTimeout(); 217var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 220await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 223var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 241var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 244_ = await client.SendHubMessageAsync(new InvocationMessage("1", nameof(MethodHub.BlockingMethod), Array.Empty<object>())).DefaultTimeout(); 247var invocationId = await client.SendHubMessageAsync(new InvocationMessage("2", nameof(MethodHub.GetClientResult), new object[] { 5 })).DefaultTimeout(); 248var invocationId2 = await client.SendHubMessageAsync(new InvocationMessage("3", nameof(MethodHub.GetClientResult), new object[] { 5 })).DefaultTimeout(); 249var invocationId3 = await client.SendHubMessageAsync(new InvocationMessage("4", nameof(MethodHub.GetClientResult), new object[] { 5 })).DefaultTimeout(); 253var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 254var invocationMessage2 = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 255var invocationMessage3 = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 261await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 262var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 267await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage2.InvocationId, res)).DefaultTimeout(); 268completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 273await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage3.InvocationId, res)).DefaultTimeout(); 274completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 295var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 297var completionMessage = await client.InvokeAsync(nameof(MethodHub.BackgroundClientResult)).DefaultTimeout(); 301var task = await Task.WhenAny(tcsService.EndMethod.Task, client.ReadAsync()).DefaultTimeout(); 310await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 312Assert.Equal(5, await tcsService.EndMethod.Task.DefaultTimeout()); 315completionMessage = await client.InvokeAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout(); 375var message = await client.ReadAsync().DefaultTimeout(); 384var ex = await Assert.ThrowsAsync<HubException>(() => resultTask).DefaultTimeout(); 388await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 392var completion = await client.InvokeAsync(nameof(HubT.Echo), "test").DefaultTimeout(); 420var message = await client.ReadAsync().DefaultTimeout(); 429var ex = await Assert.ThrowsAsync<HubException>(() => resultTask).DefaultTimeout(); 433await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 437var completion = await client.InvokeAsync("Echo", "test").DefaultTimeout(); 454var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 459var invocationId = await client.BeginUploadStreamAsync("1", nameof(MethodHub.GetClientResultWithStream), new[] { streamId }, Array.Empty<object>()).DefaultTimeout(); 462var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 468await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 470var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 475var completionMessage = await client.InvokeAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout(); 495var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 497var invocationId = await client.SendStreamInvocationAsync(nameof(MethodHub.StreamWithClientResult)).DefaultTimeout(); 500var invocationMessage = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 503await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 505var streamItem = Assert.IsType<StreamItemMessage>(await client.ReadAsync().DefaultTimeout()); 509var completionMessage = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 513completionMessage = await client.InvokeAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout();
HubConnectionHandlerTests.cs (330)
79var result = (await client.InvokeAsync(nameof(HubWithAsyncDisposable.Test)).DefaultTimeout()); 155await client.SendInvocationAsync(nameof(AbortHub.Kill)).DefaultTimeout(); 157var close = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 321var message = await client.ReadAsync(isHandshake: true).DefaultTimeout(); 405var completionMessage = await task.DefaultTimeout() as CompletionMessage; 560var completionMessage = await client.ReadAsync().DefaultTimeout() as CompletionMessage; 565completionMessage = await client.ReadAsync().DefaultTimeout() as CompletionMessage; 571CloseMessage closeMessage = await client.ReadAsync().DefaultTimeout() as CloseMessage; 611var completionMessage = await client.ReadAsync().DefaultTimeout() as CompletionMessage; 616completionMessage = await client.ReadAsync().DefaultTimeout() as CompletionMessage; 621completionMessage = await client.ReadAsync().DefaultTimeout() as CompletionMessage; 806var result = (await client.InvokeAsync(nameof(MethodHub.TaskValueMethod)).DefaultTimeout()).Result; 832var result = (await client.InvokeAsync(nameof(MethodHub.ValueTaskValueMethod)).DefaultTimeout()).Result; 858var result = (await client.InvokeAsync(nameof(MethodHub.ValueTaskMethod)).DefaultTimeout()).Result; 882var result = (await client.InvokeAsync("echo", "hello").DefaultTimeout()).Result; 928var message = await client.InvokeAsync(methodName).DefaultTimeout(); 960await client.SendInvocationAsync(nameof(MethodHub.BlockingMethod)).DefaultTimeout(); 964var closeMessage = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 997var message = await client.InvokeAsync(methodName).DefaultTimeout(); 1022await client.SendInvocationAsync(nameof(MethodHub.ValueMethod), nonBlocking: true).DefaultTimeout(); 1051var result = (await client.InvokeAsync(nameof(MethodHub.VoidMethod)).DefaultTimeout()).Result; 1076var result = (await client.InvokeAsync("RenamedMethod").DefaultTimeout()).Result; 1102var result = (await client.InvokeAsync("RenamedVirtualMethod").DefaultTimeout()).Result; 1138await client.SendInvocationAsync(methodName, nonBlocking: true).DefaultTimeout(); 1144var closeMessage = await client.ReadAsync().DefaultTimeout(); 1165var result = (await client.InvokeAsync(nameof(MethodHub.ConcatString), (byte)32, 42, 'm', "string").DefaultTimeout()).Result; 1190var result = (await client.InvokeAsync(nameof(InheritedHub.BaseMethod), "string").DefaultTimeout()).Result; 1215var result = (await client.InvokeAsync(nameof(InheritedHub.VirtualMethod), 10).DefaultTimeout()).Result; 1240var result = await client.InvokeAsync(nameof(MethodHub.OnDisconnectedAsync)).DefaultTimeout(); 1284var result = await client.InvokeAsync(nameof(MethodHub.StaticMethod)).DefaultTimeout(); 1309var result = await client.InvokeAsync(nameof(MethodHub.ToString)).DefaultTimeout(); 1312result = await client.InvokeAsync(nameof(MethodHub.GetHashCode)).DefaultTimeout(); 1315result = await client.InvokeAsync(nameof(MethodHub.Equals)).DefaultTimeout(); 1318result = await client.InvokeAsync(nameof(MethodHub.ReferenceEquals)).DefaultTimeout(); 1342var result = await client.InvokeAsync(nameof(MethodHub.Dispose)).DefaultTimeout(); 1383await firstClient.SendInvocationAsync(nameof(MethodHub.BroadcastMethod), "test").DefaultTimeout(); 1387secondClient.ReadAsync()).DefaultTimeout()) 1421await firstClient.SendInvocationAsync(nameof(MethodHub.SendArray)).DefaultTimeout(); 1425secondClient.ReadAsync()).DefaultTimeout()) 1459await firstClient.SendInvocationAsync("SendToOthers", "To others").DefaultTimeout(); 1461var secondClientResult = await secondClient.ReadAsync().DefaultTimeout(); 1466var firstClientResult = await firstClient.ReadAsync().DefaultTimeout(); 1469await secondClient.SendInvocationAsync("BroadcastMethod", "To everyone").DefaultTimeout(); 1470firstClientResult = await firstClient.ReadAsync().DefaultTimeout(); 1500await firstClient.SendInvocationAsync("SendToCaller", "To caller").DefaultTimeout(); 1502var firstClientResult = await firstClient.ReadAsync().DefaultTimeout(); 1507await firstClient.SendInvocationAsync("BroadcastMethod", "To everyone").DefaultTimeout(); 1508var secondClientResult = await secondClient.ReadAsync().DefaultTimeout(); 1570await firstClient.SendInvocationAsync("SendToAllExcept", "To second", excludeThirdClientId).DefaultTimeout(); 1571await firstClient.SendInvocationAsync("SendToAllExcept", "To third", excludeSecondClientId).DefaultTimeout(); 1573var secondClientResult = await secondClient.ReadAsync().DefaultTimeout(); 1578var thirdClientResult = await thirdClient.ReadAsync().DefaultTimeout(); 1614await firstClient.SendInvocationAsync("SendToMultipleClients", "Second and Third", secondAndThirdClients).DefaultTimeout(); 1616var secondClientResult = await secondClient.ReadAsync().DefaultTimeout(); 1621var thirdClientResult = await thirdClient.ReadAsync().DefaultTimeout(); 1627var hubMessage = await firstClient.ReadAsync().DefaultTimeout(); 1659await firstClient.SendInvocationAsync(nameof(MethodHub.SendToMultipleUsers), new[] { "userB", "userC" }, "Second and Third").DefaultTimeout(); 1661var secondClientResult = await secondClient.ReadAsync().DefaultTimeout(); 1666var thirdClientResult = await thirdClient.ReadAsync().DefaultTimeout(); 1672var hubMessage = await firstClient.ReadAsync().DefaultTimeout(); 1702var result = (await firstClient.InvokeAsync("GroupSendMethod", "testGroup", "test").DefaultTimeout()).Result; 1710result = (await secondClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "testGroup").DefaultTimeout()).Result; 1712await firstClient.SendInvocationAsync(nameof(MethodHub.GroupSendMethod), "testGroup", "test").DefaultTimeout(); 1715var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 1746var result = (await firstClient.InvokeAsync("GroupSendMethod", "testGroup", "test").DefaultTimeout()).Result; 1754await firstClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "testGroup").DefaultTimeout(); 1755await secondClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "testGroup").DefaultTimeout(); 1759await firstClient.SendInvocationAsync("GroupExceptSendMethod", "testGroup", "test", excludedConnectionIds).DefaultTimeout(); 1762var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 1769hubMessage = await firstClient.ReadAsync().DefaultTimeout(); 1799var result = (await firstClient.InvokeAsync("GroupSendMethod", "testGroup", "test").DefaultTimeout()).Result; 1807await firstClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "testGroup").DefaultTimeout(); 1808await secondClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "testGroup").DefaultTimeout(); 1810await firstClient.SendInvocationAsync("SendToOthersInGroup", "testGroup", "test").DefaultTimeout(); 1813var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 1820hubMessage = await firstClient.ReadAsync().DefaultTimeout(); 1850await secondClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "GroupA").DefaultTimeout(); 1851await firstClient.InvokeAsync(nameof(MethodHub.GroupAddMethod), "GroupB").DefaultTimeout(); 1854await firstClient.SendInvocationAsync(nameof(MethodHub.SendToMultipleGroups), "test", groupNames).DefaultTimeout(); 1856var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 1862hubMessage = await firstClient.ReadAsync().DefaultTimeout(); 1890await client.SendInvocationAsync(nameof(MethodHub.GroupRemoveMethod), "testGroup").DefaultTimeout(); 1916await firstClient.SendInvocationAsync("ClientSendMethod", "userB", "test").DefaultTimeout(); 1919var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 1950await firstClient.SendInvocationAsync("ConnectionSendMethod", secondClient.Connection.ConnectionId, "test").DefaultTimeout(); 1953var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 1983await firstClient.SendInvocationAsync("DelayedSend", secondClient.Connection.ConnectionId, "test").DefaultTimeout(); 1986var hubMessage = await secondClient.ReadAsync().DefaultTimeout(); 2023var messages = await client.StreamAsync(method, 4).DefaultTimeout(); 2057await client.SendHubMessageAsync(new CancelInvocationMessage(invocationId)).DefaultTimeout(); 2059var hubMessage = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 2143var message1 = await client1.ReadAsync().DefaultTimeout(); 2144var message2 = await client2.ReadAsync().DefaultTimeout(); 2213var message = await client.InvokeAsync(nameof(MethodHub.AuthMethod)).DefaultTimeout(); 2250var message = await client.InvokeAsync(nameof(MethodHub.AuthMethod)).DefaultTimeout(); 2292var close = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 2358var message = await client.InvokeAsync(nameof(MethodHub.MultiParamAuthMethod), "Hello", "World!").DefaultTimeout(); 2395await client.SendInvocationAsync(nameof(MethodHub.BroadcastItem)).DefaultTimeout(); 2397var message = (InvocationMessage)await client.ReadAsync().DefaultTimeout(); 2425await client.SendInvocationAsync(nameof(MethodHub.BroadcastItem)).DefaultTimeout(); 2427var message = (InvocationMessage)await client.ReadAsync().DefaultTimeout(); 2465await client.SendInvocationAsync(nameof(MethodHub.BroadcastItem)).DefaultTimeout(); 2467var message = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 2499await Assert.ThrowsAsync<InvalidOperationException>(async () => await await client.ConnectAsync(connectionHandler, expectedHandshakeResponseMessage: false)).DefaultTimeout(); 2523await Assert.ThrowsAsync<InvalidOperationException>(async () => await await client.ConnectAsync(connectionHandler, expectedHandshakeResponseMessage: false)).DefaultTimeout(); 2561await client2.SendInvocationAsync(nameof(MethodHub.SendToMultipleUsers), new[] { "client1" }, "Hi!").DefaultTimeout(); 2563var message = (InvocationMessage)await client1.ReadAsync().DefaultTimeout(); 2628var result = (await client.InvokeAsync(nameof(MethodHub.HasHttpContext)).DefaultTimeout()).Result; 2653var result = (await client.InvokeAsync(nameof(MethodHub.HasHttpContext)).DefaultTimeout()).Result; 2677await client.SendHubMessageAsync(PingMessage.Instance).DefaultTimeout(); 2680var completion = await client.InvokeAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout(); 2710await client.SendInvocationAsync("Echo", "foo").DefaultTimeout(); 2771while ((message = await client.ReadAsync().DefaultTimeout()) != null) 2823var id = await client.SendInvocationAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout(); 2824var result = await client.ReadAsync().DefaultTimeout(); 2922var id = await client.SendInvocationAsync(nameof(MethodHub.ValueMethod)).DefaultTimeout(); 2923var result = await client.ReadAsync().DefaultTimeout(); 3032await tcsService.StartedMethod.Task.DefaultTimeout(); 3038_ = await client.SendInvocationAsync(nameof(LongRunningHub.LongRunningMethod)).DefaultTimeout(); 3046await hubMethodTask1.DefaultTimeout(); 3047await client.ReadAsync().DefaultTimeout(); 3088await tcsService.StartedMethod.Task.DefaultTimeout(); 3120var message = await client.ReadAsync().DefaultTimeout(); 3154var message = await client.ReadAsync().DefaultTimeout(); 3187var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3190await client.SendHubMessageAsync(new StreamInvocationMessage("1", nameof(StreamingHub.BlockingStream), Array.Empty<object>())).DefaultTimeout(); 3192var completion = await client.InvokeAsync(nameof(StreamingHub.NonStream)).DefaultTimeout(); 3296await client.SendHubMessageAsync(new StreamInvocationMessage("123", nameof(StreamingHub.BlockingStream), Array.Empty<object>())).DefaultTimeout(); 3298await client.SendHubMessageAsync(new StreamInvocationMessage("123", nameof(StreamingHub.BlockingStream), Array.Empty<object>())).DefaultTimeout(); 3300var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 3335var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3338await client.SendInvocationAsync(nameof(LongRunningHub.LongRunningMethod), nonBlocking: false).DefaultTimeout(); 3340await tcsService.StartedMethod.Task.DefaultTimeout(); 3343await client.SendInvocationAsync(nameof(LongRunningHub.SimpleMethod), nonBlocking: false).DefaultTimeout(); 3351var firstResult = await client.ReadAsync().DefaultTimeout(); 3357var secondResult = await client.ReadAsync().DefaultTimeout(); 3390var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3393await client.SendInvocationAsync(nameof(LongRunningHub.LongRunningMethod), nonBlocking: false).DefaultTimeout(); 3395await tcsService.StartedMethod.Task.DefaultTimeout(); 3400await client.SendInvocationAsync(nameof(LongRunningHub.SimpleMethod), nonBlocking: false).DefaultTimeout(); 3403var secondResult = await client.ReadAsync().DefaultTimeout(); 3413var firstResult = await client.ReadAsync().DefaultTimeout(); 3446var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3449await client.SendInvocationAsync(nameof(LongRunningHub.LongRunningMethod), nonBlocking: false).DefaultTimeout(); 3451await tcsService.StartedMethod.Task.DefaultTimeout(); 3457await client.SendInvocationAsync(nameof(LongRunningHub.LongRunningMethod), nonBlocking: false).DefaultTimeout(); 3459await tcsService.StartedMethod.Task.DefaultTimeout(); 3462await client.SendInvocationAsync(nameof(LongRunningHub.SimpleMethod), nonBlocking: false).DefaultTimeout(); 3470var firstResult = await client.ReadAsync().DefaultTimeout(); 3476var secondResult = await client.ReadAsync().DefaultTimeout(); 3484firstResult = await client.ReadAsync().DefaultTimeout(); 3517var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3520var streamInvocationId = await client.SendStreamInvocationAsync(nameof(LongRunningHub.LongRunningStream), null).DefaultTimeout(); 3522await tcsService.StartedMethod.Task.DefaultTimeout(); 3525var completion = await client.InvokeAsync(nameof(LongRunningHub.SimpleMethod)).DefaultTimeout(); 3534await client.SendHubMessageAsync(new CancelInvocationMessage(streamInvocationId)).DefaultTimeout(); 3537completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 3564var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3572await client.ReadAsync().DefaultTimeout(); 3574var closeMessage = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 3601var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3602await client.BeginUploadStreamAsync("invocationId", nameof(MethodHub.StreamDontRead), new[] { "id" }, Array.Empty<object>()).DefaultTimeout(); 3606await client.SendHubMessageAsync(new StreamItemMessage("id", letter)).DefaultTimeout(); 3612var result = (CompletionMessage)await client.ReadAsync().DefaultTimeout(5000); 3625var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3630await client.SendHubMessageAsync(new StreamItemMessage("id", letter)).DefaultTimeout(); 3633await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 3634var result = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 3648var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3654await client.SendHubMessageAsync(new StreamItemMessage("id", thing)).DefaultTimeout(); 3657await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 3658var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 3676var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3690await client.SendHubMessageAsync(new StreamItemMessage(spot.ToString(CultureInfo.InvariantCulture), words[spot][pos[spot]])).DefaultTimeout(); 3696await client.SendHubMessageAsync(CompletionMessage.Empty(id)).DefaultTimeout(); 3697var response = await client.ReadAsync().DefaultTimeout(); 3740var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3742await tcsService.StartedMethod.Task.DefaultTimeout(); 3747await client.SendHubMessageAsync(new StreamItemMessage("id", thing)).DefaultTimeout(); 3752await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 3753var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 3776var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3778await tcsService.StartedMethod.Task.DefaultTimeout(); 3780var completion = await client.InvokeAsync(nameof(LongRunningHub.SimpleMethod)).DefaultTimeout(); 3784await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 3786await tcsService.EndMethod.Task.DefaultTimeout(); 3787var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 3806var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3808await client.SendInvocationAsync(nameof(MethodHub.ProtocolError)).DefaultTimeout(); 3828await client.SendInvocationAsync(nameof(ConnectionLifetimeHub.ProtocolErrorSelf)).DefaultTimeout(); 3851await client.SendInvocationAsync(nameof(ConnectionLifetimeHub.ProtocolErrorAll)).DefaultTimeout(); 3872var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3873await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: new[] { "id" }, Array.Empty<object>()).DefaultTimeout(); 3876await client.SendHubMessageAsync(new StreamItemMessage("id", 5)).DefaultTimeout(); 3877await client.SendHubMessageAsync(new StreamItemMessage("id", 10)).DefaultTimeout(); 3879await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 3880var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 3903var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3923var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3924await client.BeginUploadStreamAsync("invocationId", nameof(MethodHub.TestTypeCastingErrors), new[] { "channelId" }, Array.Empty<object>()).DefaultTimeout(); 3928await client.SendHubMessageAsync(new StreamItemMessage("channelId", "not a number")).DefaultTimeout(); 3929var response = await client.ReadAsync().DefaultTimeout(); 3950var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3951await client.SendHubMessageAsync(new StreamItemMessage("fake_id", "not a number")).DefaultTimeout(); 3975var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 3976await client.SendHubMessageAsync(CompletionMessage.Empty("fake_id")).DefaultTimeout(); 3999await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4000await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.TestCustomErrorPassing), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4001await client.SendHubMessageAsync(CompletionMessage.WithError("id", CustomErrorMessage)).DefaultTimeout(); 4003var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 4019await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4020await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: new[] { "id", "id2" }, args: Array.Empty<object>()).DefaultTimeout(); 4022var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 4038await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4039await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: Array.Empty<string>(), args: Array.Empty<object>()).DefaultTimeout(); 4041var response = (CompletionMessage)await client.ReadAsync().DefaultTimeout(); 4060var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4062await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4064await client.SendHubMessageAsync(new StreamItemMessage("id", "hello")).DefaultTimeout(); 4065await client.SendHubMessageAsync(new StreamItemMessage("id", " world")).DefaultTimeout(); 4066await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 4067var result = await client.ReadAsync().DefaultTimeout(); 4098var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4104await client.BeginUploadStreamAsync(invocationId: null, nameof(MethodHub.StreamingConcat), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4105await client.SendHubMessageAsync(new StreamItemMessage("id", "hello")).DefaultTimeout(); 4106await client.SendHubMessageAsync(new StreamItemMessage("id", " world")).DefaultTimeout(); 4110await client.SendHubMessageAsync(CompletionMessage.Empty("id")).DefaultTimeout(); 4135var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4137await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.UploadIgnoreItems), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4139await client.SendHubMessageAsync(new StreamItemMessage("id", "ignored")).DefaultTimeout(); 4140var result = await client.ReadAsync().DefaultTimeout(); 4146await client.SendHubMessageAsync(new StreamItemMessage("id", "error!")).DefaultTimeout(); 4149await client.SendInvocationAsync("VoidMethod").DefaultTimeout(); 4172var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4174await client.SendStreamInvocationAsync(nameof(MethodHub.StreamAndUploadIgnoreItems), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4176await client.SendHubMessageAsync(new StreamItemMessage("id", "ignored")).DefaultTimeout(); 4177var result = await client.ReadAsync().DefaultTimeout(); 4183await client.SendHubMessageAsync(new StreamItemMessage("id", "error!")).DefaultTimeout(); 4186await client.SendInvocationAsync("VoidMethod").DefaultTimeout(); 4218var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4220var streamInvocationId = await client.SendStreamInvocationAsync(methodName, args).DefaultTimeout(); 4222await tcsService.StartedMethod.Task.DefaultTimeout(); 4225await client.SendHubMessageAsync(new CancelInvocationMessage(streamInvocationId)).DefaultTimeout(); 4227var result = await client.ReadAsync().DefaultTimeout(); 4233await tcsService.EndMethod.Task.DefaultTimeout(); 4261var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4264var invocationId = await client.SendStreamInvocationAsync(methodName, count).DefaultTimeout(); 4270await listeningMessages.ReadAsync(count).DefaultTimeout(); 4273await client.SendHubMessageAsync(new CancelInvocationMessage(invocationId)).DefaultTimeout(); 4276var messages = await listeningMessages.ReadAllAsync().DefaultTimeout(); 4280await tcsService.EndMethod.Task.DefaultTimeout(); 4304var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4306var streamInvocationId = await client.SendStreamInvocationAsync(nameof(LongRunningHub.CancelableStreamSingleParameter)).DefaultTimeout(); 4308await tcsService.StartedMethod.Task.DefaultTimeout(); 4314await tcsService.EndMethod.Task.DefaultTimeout(); 4335var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4337var streamInvocationId = await client.SendStreamInvocationAsync(nameof(LongRunningHub.StreamNullableParameter), 5, null).DefaultTimeout(); 4339var firstArgument = await tcsService.StartedMethod.Task.DefaultTimeout(); 4342var secondArgument = await tcsService.EndMethod.Task.DefaultTimeout(); 4362var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4364var streamInvocationId = await client.SendStreamInvocationAsync(nameof(LongRunningHub.CancelableStreamNullableParameter), 5, null).DefaultTimeout(); 4366var firstArgument = await tcsService.StartedMethod.Task.DefaultTimeout(); 4370await client.SendHubMessageAsync(new CancelInvocationMessage(streamInvocationId)).DefaultTimeout(); 4372var secondArgument = await tcsService.EndMethod.Task.DefaultTimeout(); 4388var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4390var invocationId = await client.SendInvocationAsync(nameof(MethodHub.InvalidArgument)).DefaultTimeout(); 4392var completion = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 4421var messagePromise = client.StreamAsync(nameof(StreamingHub.StreamEcho), new[] { streamId }, Array.Empty<object>()).DefaultTimeout(); 4490var messages = await client.StreamAsync(method, argument).DefaultTimeout(); 4524var message = Assert.IsType<InvocationMessage>(await client.ReadAsync().DefaultTimeout()); 4550var message = await client.ReadAsync().DefaultTimeout(); 4574await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.UploadDoesWorkOnComplete), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4576await client.SendHubMessageAsync(new StreamItemMessage("id", "hello")).DefaultTimeout(); 4585var exception = await Assert.ThrowsAsync<OperationCanceledException>(() => task).DefaultTimeout(); 4640var message = await client.ReadAsync().DefaultTimeout(); 4660var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4661var res = await client.InvokeAsync(nameof(ServicesHub.SingleService)).DefaultTimeout(); 4677var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4678var res = await client.InvokeAsync(nameof(ServicesHub.SingleService)).DefaultTimeout(); 4696var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4697var res = await client.InvokeAsync(nameof(ServicesHub.MultipleServices)).DefaultTimeout(); 4715var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4716await client.BeginUploadStreamAsync("0", nameof(ServicesHub.ServicesAndParams), new string[] { "1" }, 10, true).DefaultTimeout(); 4718await client.SendHubMessageAsync(new StreamItemMessage("1", 1)).DefaultTimeout(); 4719await client.SendHubMessageAsync(new StreamItemMessage("1", 14)).DefaultTimeout(); 4721await client.SendHubMessageAsync(CompletionMessage.Empty("1")).DefaultTimeout(); 4723var response = Assert.IsType<CompletionMessage>(await client.ReadAsync().DefaultTimeout()); 4740var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4741var res = await client.InvokeAsync(nameof(ServicesHub.Stream)).DefaultTimeout(); 4762var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4763var res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout(); 4783var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4784var res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout(); 4804var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4805var res = await client.InvokeAsync(nameof(ServicesHub.IEnumerableOfServiceWithoutAttribute)).DefaultTimeout(); 4829var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4830var res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout(); 4852var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4853var res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithAndWithoutAttribute)).DefaultTimeout(); 4874var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4875var res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithAndWithoutAttribute)).DefaultTimeout(); 4894var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4895var res = await client.InvokeAsync(nameof(ServicesHub.ServiceWithoutAttribute)).DefaultTimeout(); 4914var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4915var res = await client.InvokeAsync(nameof(ServicesHub.IEnumerableOfServiceWithoutAttribute)).DefaultTimeout(); 4937var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4938var res = await client.InvokeAsync(nameof(KeyedServicesHub.KeyedService)).DefaultTimeout(); 4960var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4961var res = await client.InvokeAsync(nameof(KeyedServicesHub.KeyedServiceWithParam), 91).DefaultTimeout(); 4984var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 4985var res = await client.InvokeAsync(nameof(KeyedServicesHub.KeyedServiceNonKeyedService)).DefaultTimeout(); 5007var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5008var res = await client.InvokeAsync(nameof(KeyedServicesHub.MultipleKeyedServices)).DefaultTimeout(); 5030var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5031var res = await client.InvokeAsync(nameof(KeyedServicesHub.MultipleSameKeyedServices)).DefaultTimeout(); 5100var connectionHandlerTask = await client1.ConnectAsync(connectionHandler).DefaultTimeout(); 5101_ = await client2.ConnectAsync(connectionHandler).DefaultTimeout(); 5103var message = Assert.IsType<InvocationMessage>(await client1.ReadAsync().DefaultTimeout()); 5125var message = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 5150var message = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout()); 5177var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5179await client.SendHubMessageAsync(new SequenceMessage(10)).DefaultTimeout(); 5180await client.SendHubMessageAsync(new AckMessage(234)).DefaultTimeout(); 5207var connectionHandlerTask = await client.ConnectAsync(connectionHandler).DefaultTimeout(); 5209await client.InvokeAsync(nameof(MethodHub.Echo), new object[] { new string('x', 500) }).DefaultTimeout(); 5212await client.SendInvocationAsync(nameof(MethodHub.Echo), new object[] { "t" }).DefaultTimeout(); 5218await client.SendHubMessageAsync(new AckMessage(1)).DefaultTimeout(); 5258var seqMessage = Assert.IsType<SequenceMessage>(await client.ReadAsync().DefaultTimeout()); 5261await client.SendHubMessageAsync(new SequenceMessage(1)).DefaultTimeout(); 5323var message = Assert.IsType<CloseMessage>(await client.ReadAsync().DefaultTimeout());
HubFilterTests.cs (44)
120await tcsService.StartedMethod.Task.DefaultTimeout(); 122await tcsService.EndMethod.Task.DefaultTimeout(); 125var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 126await tcsService.EndMethod.Task.DefaultTimeout(); 135await tcsService.EndMethod.Task.DefaultTimeout(); 194await tcsService1.StartedMethod.Task.DefaultTimeout(); 195await tcsService2.StartedMethod.Task.DefaultTimeout(); 197await tcsService1.EndMethod.Task.DefaultTimeout(); 198await tcsService2.EndMethod.Task.DefaultTimeout(); 202var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 203await tcsService1.EndMethod.Task.DefaultTimeout(); 204await tcsService2.EndMethod.Task.DefaultTimeout(); 214await tcsService1.EndMethod.Task.DefaultTimeout(); 215await tcsService2.EndMethod.Task.DefaultTimeout(); 244await tcsService1.StartedMethod.Task.DefaultTimeout(); 245await tcsService2.StartedMethod.Task.DefaultTimeout(); 247await tcsService1.EndMethod.Task.DefaultTimeout(); 248await tcsService2.EndMethod.Task.DefaultTimeout(); 252var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 253await tcsService1.EndMethod.Task.DefaultTimeout(); 254await tcsService2.EndMethod.Task.DefaultTimeout(); 264await tcsService1.EndMethod.Task.DefaultTimeout(); 265await tcsService2.EndMethod.Task.DefaultTimeout(); 295await tcsService1.StartedMethod.Task.DefaultTimeout(); 296await tcsService2.StartedMethod.Task.DefaultTimeout(); 298await tcsService1.EndMethod.Task.DefaultTimeout(); 299await tcsService2.EndMethod.Task.DefaultTimeout(); 303var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 304await tcsService1.EndMethod.Task.DefaultTimeout(); 305await tcsService2.EndMethod.Task.DefaultTimeout(); 315await tcsService1.EndMethod.Task.DefaultTimeout(); 316await tcsService2.EndMethod.Task.DefaultTimeout(); 361var message = await invokeTask.DefaultTimeout(); 421var message = await invokeTask.DefaultTimeout(); 483var message = await invokeTask.DefaultTimeout(); 551var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 599var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 700var message = await client.InvokeAsync(nameof(MethodHub.Echo), "Hello world!").DefaultTimeout(); 736await tcsService.StartedMethod.Task.DefaultTimeout(); 741await tcsService.StartedMethod.Task.DefaultTimeout(); 747await tcsService.StartedMethod.Task.DefaultTimeout(); 812await tcsService.StartedMethod.Task.DefaultTimeout(); 817await tcsService.StartedMethod.Task.DefaultTimeout(); 823await tcsService.StartedMethod.Task.DefaultTimeout();
Internal\TypedClientBuilderTests.cs (1)
238var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => typedProxy.GetValue(102, objArg, "test")).DefaultTimeout();
NativeAotTests.cs (3)
47var result = await connection.InvokeAsync<int>(nameof(AsyncMethodHub.TaskValueMethod)).DefaultTimeout(); 50result = await connection.InvokeAsync<int>(nameof(AsyncMethodHub.ValueTaskValueMethod)).DefaultTimeout(); 53result = await connection.InvokeAsync<int>(nameof(AsyncMethodHub.CustomTaskValueMethod)).DefaultTimeout();
SerializedHubMessageTests.cs (2)
81await firstSerialization.DefaultTimeout(); 82await secondSerialization.DefaultTimeout();
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
TestClient.cs (1)
85HandshakeResponseMessage = (HandshakeResponseMessage)await ReadAsync(true).DefaultTimeout();
Microsoft.AspNetCore.TestHost.Tests (30)
ClientHandlerTests.cs (2)
458await Assert.ThrowsAsync<OperationCanceledException>(() => readTask.DefaultTimeout()); 481await Assert.ThrowsAsync<OperationCanceledException>(() => readTask.DefaultTimeout());
HttpContextBuilderTests.cs (3)
212await Assert.ThrowsAsync<OperationCanceledException>(() => readTask.DefaultTimeout()); 236await Assert.ThrowsAsync<OperationCanceledException>(() => contextTask.DefaultTimeout()); 262await Assert.ThrowsAsync<OperationCanceledException>(() => readTask.DefaultTimeout());
ResponseBodyTests.cs (1)
149read = await zeroByteRead.DefaultTimeout();
TestClientTests.cs (24)
99var response = await client.PutAsync("http://localhost:12345", content).DefaultTimeout(); 102Assert.Equal("Hello world PUT Response", await response.Content.ReadAsStringAsync().DefaultTimeout()); 117var response = await client.PostAsync("http://localhost:12345", content).DefaultTimeout(); 120Assert.Equal("Hello world POST Response", await response.Content.ReadAsStringAsync().DefaultTimeout()); 205var response = await client.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 210var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 218var length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 227length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 235length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 313var response = await client.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 318var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 370var response = await client.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 372var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 378var length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 398length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 432var response = await client.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 434var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 444var length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 479var response = await client.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 481var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 489var length = await responseContent.ReadAsync(buffer).AsTask().DefaultTimeout(); 530var response = await client.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout(); 532var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 545"Flush was canceled on underlying PipeWriter.").DefaultTimeout();
Sockets.FunctionalTests (15)
src\Servers\Kestrel\shared\test\TestApp.cs (2)
22await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout(); 52await request.Body.FillBufferUntilEndAsync(buffer).DefaultTimeout();
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (2)
200var closingMessageTask = WaitForLogMessage(m => m.Message.Contains("is closing.")).DefaultTimeout(); 207var closedMessageTask = WaitForLogMessage(m => m.Message.Contains("is closed. The last processed stream ID was 1.")).DefaultTimeout();
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (1)
412var count = await stream.ReadAsync(responseBuffer, 0, exptectedLength - matchedChars).DefaultTimeout();
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (4)
888await registrationTcs.Task.DefaultTimeout(); 925var abortedRequestId = await registrationTcs.Task.DefaultTimeout(); 1087await Assert.ThrowsAnyAsync<IOException>(() => readTcs.Task).DefaultTimeout(); 1149var count = await stream.ReadAsync(responseBuffer, 0, expectedLength - matchedChars).DefaultTimeout();
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (4)
250await Assert.ThrowsAnyAsync<OperationCanceledException>(async () => await writeTcs.Task).DefaultTimeout(); 343await Assert.ThrowsAnyAsync<OperationCanceledException>(() => writeTcs.Task).DefaultTimeout(); 843await Assert.ThrowsAnyAsync<OperationCanceledException>(() => copyToAsyncCts.Task).DefaultTimeout(); 1101var bytes = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length).DefaultTimeout();
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
102await socket.SendAsync(data, SocketFlags.None).DefaultTimeout(); 170await socket.SendAsync(httpRequest, SocketFlags.None).DefaultTimeout();