Merge branch 'release/2.2'
This commit is contained in:
commit
cba79d1687
|
|
@ -59,7 +59,7 @@ export class LongPollingTransport implements ITransport {
|
|||
const pollOptions: HttpRequest = {
|
||||
abortSignal: this.pollAbort.signal,
|
||||
headers: {},
|
||||
timeout: 90000,
|
||||
timeout: 100000,
|
||||
};
|
||||
|
||||
if (transferFormat === TransferFormat.Binary) {
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal
|
|||
{
|
||||
Task disposeTask;
|
||||
|
||||
Cancellation?.Dispose();
|
||||
|
||||
await StateLock.WaitAsync();
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -313,10 +313,6 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal
|
|||
connection.LastSeenUtc = DateTime.UtcNow;
|
||||
|
||||
connection.Status = HttpConnectionStatus.Inactive;
|
||||
|
||||
connection.Cancellation?.Cancel();
|
||||
|
||||
connection.Cancellation = null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
|
|
|||
|
|
@ -398,8 +398,15 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
|
|||
[MemberData(nameof(HubProtocolsAndTransportsAndHubPaths))]
|
||||
public async Task StreamDoesNotStartIfTokenAlreadyCanceled(string protocolName, HttpTransportType transportType, string path)
|
||||
{
|
||||
bool ExpectedErrors(WriteContext writeContext)
|
||||
{
|
||||
return (writeContext.LoggerName == nameof(Http.Connections.Client.Internal.ServerSentEventsTransport) ||
|
||||
writeContext.LoggerName == nameof(Http.Connections.Client.Internal.LongPollingTransport)) &&
|
||||
writeContext.EventId.Name == "ErrorSending";
|
||||
}
|
||||
|
||||
var protocol = HubProtocols[protocolName];
|
||||
using (StartVerifiableLog(out var loggerFactory, LogLevel.Trace, $"{nameof(StreamDoesNotStartIfTokenAlreadyCanceled)}_{protocol.Name}_{transportType}_{path.TrimStart('/')}"))
|
||||
using (StartVerifiableLog(out var loggerFactory, LogLevel.Trace, $"{nameof(StreamDoesNotStartIfTokenAlreadyCanceled)}_{protocol.Name}_{transportType}_{path.TrimStart('/')}", expectedErrorsFilter: ExpectedErrors))
|
||||
{
|
||||
var connection = CreateHubConnection(path, transportType, protocol, loggerFactory);
|
||||
try
|
||||
|
|
|
|||
|
|
@ -50,6 +50,13 @@ namespace Microsoft.AspNetCore.SignalR.Redis.Tests
|
|||
|
||||
private static string GetDockerLocation()
|
||||
{
|
||||
// OSX + Docker + Redis don't play well together for some reason. We already have these tests covered on Linux and Windows
|
||||
// So we are happy ignoring them on OSX
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator))
|
||||
{
|
||||
var candidate = Path.Combine(dir, "docker" + _exeSuffix);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.SignalR.Redis.Tests
|
|||
}
|
||||
|
||||
var testLog = AssemblyTestLog.ForAssembly(typeof(RedisServerFixture<TStartup>).Assembly);
|
||||
_logToken = testLog.StartTestLog(null, $"{nameof(RedisServerFixture<TStartup>)}_{typeof(TStartup).Name}", out _loggerFactory, "RedisServerFixture");
|
||||
_logToken = testLog.StartTestLog(null, $"{nameof(RedisServerFixture<TStartup>)}_{typeof(TStartup).Name}", out _loggerFactory, LogLevel.Trace, "RedisServerFixture");
|
||||
_logger = _loggerFactory.CreateLogger<RedisServerFixture<TStartup>>();
|
||||
|
||||
Docker.Default.Start(_logger);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
|||
private readonly ConcurrentDictionary<string, ILogger> _serverLoggers;
|
||||
private readonly ILogger _scopeLogger;
|
||||
private readonly object _lock;
|
||||
private bool _disposed;
|
||||
|
||||
public ServerLogScope(ServerFixture serverFixture, ILoggerFactory loggerFactory, IDisposable wrappedDisposable)
|
||||
{
|
||||
|
|
@ -45,11 +46,15 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
|||
|
||||
ILogger logger;
|
||||
|
||||
// There maybe thready safety issues in logging when creating multiple loggers at the same time
|
||||
// https://github.com/aspnet/Logging/issues/810
|
||||
lock (_lock)
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Create (or get) a logger with the same name as the server logger
|
||||
// Call in the lock to avoid ODE where LoggerFactory could be disposed by the wrapped disposable
|
||||
logger = _serverLoggers.GetOrAdd(write.LoggerName, loggerName => _loggerFactory.CreateLogger("SERVER " + loggerName));
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +67,11 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
|||
|
||||
_scopeLogger.LogInformation("Server log scope stopped.");
|
||||
|
||||
_wrappedDisposable?.Dispose();
|
||||
lock (_lock)
|
||||
{
|
||||
_wrappedDisposable?.Dispose();
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue