Reenable application initialization module tests (#7024)
This commit is contained in:
parent
1aa50faa29
commit
141f3d8781
|
|
@ -182,9 +182,16 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
|
||||||
|
|
||||||
private string GetOriginalPath()
|
private string GetOriginalPath()
|
||||||
{
|
{
|
||||||
// applicationInitialization request might have trailing \0 character included in the length
|
|
||||||
// check and skip it
|
|
||||||
var rawUrlInBytes = GetRawUrlInBytes();
|
var rawUrlInBytes = GetRawUrlInBytes();
|
||||||
|
|
||||||
|
// Pre Windows 10 RS2 applicationInitialization request might not have pRawUrl set, fallback to cocked url
|
||||||
|
if (rawUrlInBytes == null)
|
||||||
|
{
|
||||||
|
return GetCookedUrl().GetAbsPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ApplicationInitialization request might have trailing \0 character included in the length
|
||||||
|
// check and skip it
|
||||||
if (rawUrlInBytes.Length > 0 && rawUrlInBytes[rawUrlInBytes.Length - 1] == 0)
|
if (rawUrlInBytes.Length > 0 && rawUrlInBytes[rawUrlInBytes.Length - 1] == 0)
|
||||||
{
|
{
|
||||||
var newRawUrlInBytes = new byte[rawUrlInBytes.Length - 1];
|
var newRawUrlInBytes = new byte[rawUrlInBytes.Length - 1];
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Task Retry(Func<Task> func, TimeSpan maxTime)
|
||||||
|
{
|
||||||
|
return Retry(func, (int)(maxTime.TotalMilliseconds / 200), 200);
|
||||||
|
}
|
||||||
|
|
||||||
public static async Task Retry(Func<Task> func, int attempts, int msDelay)
|
public static async Task Retry(Func<Task> func, int attempts, int msDelay)
|
||||||
{
|
{
|
||||||
var exceptions = new List<Exception>();
|
var exceptions = new List<Exception>();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace IIS.FunctionalTests
|
||||||
_fixture = fixture;
|
_fixture = fixture;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
|
[ConditionalTheory]
|
||||||
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
|
|
@ -42,14 +42,15 @@ namespace IIS.FunctionalTests
|
||||||
|
|
||||||
var result = await DeployAsync(baseDeploymentParameters);
|
var result = await DeployAsync(baseDeploymentParameters);
|
||||||
|
|
||||||
await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), 10, 200);
|
await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue);
|
||||||
StopServer();
|
StopServer();
|
||||||
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.Started(result));
|
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.Started(result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
|
[ConditionalTheory]
|
||||||
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
||||||
|
[RequiresNewHandler]
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
public async Task ApplicationInitializationPageIsRequested(HostingModel hostingModel)
|
public async Task ApplicationInitializationPageIsRequested(HostingModel hostingModel)
|
||||||
|
|
@ -70,7 +71,7 @@ namespace IIS.FunctionalTests
|
||||||
|
|
||||||
var result = await DeployAsync(baseDeploymentParameters);
|
var result = await DeployAsync(baseDeploymentParameters);
|
||||||
|
|
||||||
await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), 10, 200);
|
await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue);
|
||||||
StopServer();
|
StopServer();
|
||||||
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.Started(result));
|
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.Started(result));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||||
namespace Microsoft.AspNetCore.HttpSys.Internal
|
namespace Microsoft.AspNetCore.HttpSys.Internal
|
||||||
{
|
{
|
||||||
// Note this type should only be used while the request buffer remains pinned
|
// Note this type should only be used while the request buffer remains pinned
|
||||||
internal class CookedUrl
|
internal readonly struct CookedUrl
|
||||||
{
|
{
|
||||||
private readonly HttpApiTypes.HTTP_COOKED_URL _nativeCookedUrl;
|
private readonly HttpApiTypes.HTTP_COOKED_URL _nativeCookedUrl;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue