Reenable application initialization module tests (#7024)

This commit is contained in:
Pavel Krymets 2019-01-28 09:24:42 -08:00 committed by GitHub
parent 1aa50faa29
commit 141f3d8781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 8 deletions

View File

@ -182,9 +182,16 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
private string GetOriginalPath()
{
// applicationInitialization request might have trailing \0 character included in the length
// check and skip it
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)
{
var newRawUrlInBytes = new byte[rawUrlInBytes.Length - 1];

View File

@ -128,6 +128,11 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
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)
{
var exceptions = new List<Exception>();

View File

@ -26,7 +26,7 @@ namespace IIS.FunctionalTests
_fixture = fixture;
}
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
[ConditionalTheory]
[RequiresIIS(IISCapability.ApplicationInitialization)]
[InlineData(HostingModel.InProcess)]
[InlineData(HostingModel.OutOfProcess)]
@ -42,14 +42,15 @@ namespace IIS.FunctionalTests
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();
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.Started(result));
}
}
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
[ConditionalTheory]
[RequiresIIS(IISCapability.ApplicationInitialization)]
[RequiresNewHandler]
[InlineData(HostingModel.InProcess)]
[InlineData(HostingModel.OutOfProcess)]
public async Task ApplicationInitializationPageIsRequested(HostingModel hostingModel)
@ -70,7 +71,7 @@ namespace IIS.FunctionalTests
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();
EventLogHelpers.VerifyEventLogEvent(result, EventLogHelpers.Started(result));
}

View File

@ -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.
using System;
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
namespace Microsoft.AspNetCore.HttpSys.Internal
{
// 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;