From 81fa9c8fcf9d47f93bfb147a74fd4b4354377d22 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 17 Jul 2017 16:40:06 -0700 Subject: [PATCH 1/2] Increase wait timeouts for flaky tests (#6548) * Increase wait timeouts for flaky tests Fixes #6540 --- .../CacheTagHelperTest.cs | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/CacheTagHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/CacheTagHelperTest.cs index 31639c0456..589ce007f8 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/CacheTagHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/CacheTagHelperTest.cs @@ -854,7 +854,13 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers // Arrange var expected = new DivideByZeroException(); var cache = new TestMemoryCache(); - var cacheTagHelper = new CacheTagHelper(new CacheTagHelperMemoryCacheFactory(cache), new HtmlTestEncoder()) + // The two instances represent two instances of the same cache tag helper appearance in the page. + var cacheTagHelper1 = new CacheTagHelper(new CacheTagHelperMemoryCacheFactory(cache), new HtmlTestEncoder()) + { + ViewContext = GetViewContext(), + Enabled = true + }; + var cacheTagHelper2 = new CacheTagHelper(new CacheTagHelperMemoryCacheFactory(cache), new HtmlTestEncoder()) { ViewContext = GetViewContext(), Enabled = true @@ -871,8 +877,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers }); // Act - var task1 = Task.Run(() => cacheTagHelper.ProcessAsync(GetTagHelperContext(cache.Key1), tagHelperOutput)); - var task2 = Task.Run(() => cacheTagHelper.ProcessAsync(GetTagHelperContext(cache.Key2), tagHelperOutput)); + var task1 = Task.Run(() => cacheTagHelper1.ProcessAsync(GetTagHelperContext(cache.Key1), tagHelperOutput)); + var task2 = Task.Run(() => cacheTagHelper2.ProcessAsync(GetTagHelperContext(cache.Key2), tagHelperOutput)); // Assert await Assert.ThrowsAsync(() => task1); @@ -887,7 +893,14 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers var expected = "Hello world"; var cache = new TestMemoryCache(); var encoder = new HtmlTestEncoder(); - var cacheTagHelper = new CacheTagHelper(new CacheTagHelperMemoryCacheFactory(cache), encoder) + // The two instances represent two instances of the same cache tag helper appearance in the page. + var cacheTagHelper1 = new CacheTagHelper(new CacheTagHelperMemoryCacheFactory(cache), encoder) + { + ViewContext = GetViewContext(), + Enabled = true + }; + + var cacheTagHelper2 = new CacheTagHelper(new CacheTagHelperMemoryCacheFactory(cache), encoder) { ViewContext = GetViewContext(), Enabled = true @@ -907,8 +920,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers }); // Act - var task1 = Task.Run(() => cacheTagHelper.ProcessAsync(GetTagHelperContext(cache.Key1), tagHelperOutput)); - var task2 = Task.Run(() => cacheTagHelper.ProcessAsync(GetTagHelperContext(cache.Key2), tagHelperOutput)); + var task1 = Task.Run(() => cacheTagHelper1.ProcessAsync(GetTagHelperContext(cache.Key1), tagHelperOutput)); + var task2 = Task.Run(() => cacheTagHelper2.ProcessAsync(GetTagHelperContext(cache.Key2), tagHelperOutput)); // Assert await Task.WhenAll(task1, task2); @@ -980,7 +993,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers // a TaskCancellationSource as an entry. We want to ensure that both calls use the results of the TCS as their output. private class TestMemoryCache : IMemoryCache { - private const int WaitTimeout = 3000; + private const int WaitTimeout = 5000; public readonly string Key1 = "Key1"; public readonly string Key2 = "Key2"; public readonly ManualResetEventSlim ManualResetEvent1 = new ManualResetEventSlim(); From 843d9820e25a4023a26840bc344094c8990e54c2 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 17 Jul 2017 15:26:19 -0700 Subject: [PATCH 2/2] Add breakingchanges.netcore.json for Microsoft.AspNetCore.Mvc.Razor --- .../Microsoft.AspNetCore.Mvc.Razor.csproj | 1 - .../breakingchanges.netcore.json | 141 ++++++++++++++++++ 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.AspNetCore.Mvc.Razor/breakingchanges.netcore.json diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj b/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj index 838d1e750e..89fef2e319 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj @@ -8,7 +8,6 @@ $(NoWarn);CS1591 true aspnetcore;aspnetcoremvc;cshtml;razor - false diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/breakingchanges.netcore.json b/src/Microsoft.AspNetCore.Mvc.Razor/breakingchanges.netcore.json new file mode 100644 index 0000000000..84f844b3b1 --- /dev/null +++ b/src/Microsoft.AspNetCore.Mvc.Razor/breakingchanges.netcore.json @@ -0,0 +1,141 @@ +[ + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Compilation.RelativeFileInfo", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.TagHelpers.FeatureTagHelperTypeResolver : Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperTypeResolver", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.RazorViewEngineOptionsSetup : Microsoft.Extensions.Options.ConfigureOptions", + "Kind": "Removal" + }, + { + "TypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.Compilation.ICompilationService", + "Kind": "Removal" + }, + { + "TypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.Compilation.IRazorCompilationService", + "Kind": "Removal" + }, + { + "TypeId": "public struct Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationResult", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public .ctor()", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public static System.String InvalidTagHelperIndexerAssignment(System.String attributeName, System.String tagHelperTypeName, System.String propertyName)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public static System.Void WriteTo(System.IO.TextWriter writer, System.Text.Encodings.Web.HtmlEncoder encoder, System.Object value)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public System.Threading.Tasks.Task FlushAsync()", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public System.Void WriteAttributeValueTo(System.IO.TextWriter writer, System.String prefix, System.Int32 prefixOffset, System.Object value, System.Int32 valueOffset, System.Int32 valueLength, System.Boolean isLiteral)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public virtual System.Void BeginWriteAttributeTo(System.IO.TextWriter writer, System.String name, System.String prefix, System.Int32 prefixOffset, System.String suffix, System.Int32 suffixOffset, System.Int32 attributeValuesCount)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public virtual System.Void EndWriteAttributeTo(System.IO.TextWriter writer)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public virtual System.Void WriteLiteralTo(System.IO.TextWriter writer, System.Object value)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public virtual System.Void WriteLiteralTo(System.IO.TextWriter writer, System.String value)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public virtual System.Void WriteTo(System.IO.TextWriter writer, System.Object value)", + "Kind": "Removal" + }, + { + "TypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage", + "MemberId": "public virtual System.Void WriteTo(System.IO.TextWriter writer, System.String value)", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.ViewLocationExpanderContext", + "MemberId": "public .ctor(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.String viewName, System.String controllerName, System.String areaName, System.Boolean isMainPage)", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine : Microsoft.AspNetCore.Mvc.Razor.IRazorViewEngine", + "MemberId": "public .ctor(Microsoft.AspNetCore.Mvc.Razor.IRazorPageFactoryProvider pageFactory, Microsoft.AspNetCore.Mvc.Razor.IRazorPageActivator pageActivator, System.Text.Encodings.Web.HtmlEncoder htmlEncoder, Microsoft.Extensions.Options.IOptions optionsAccessor, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorView : Microsoft.AspNetCore.Mvc.ViewEngines.IView", + "MemberId": "public .ctor(Microsoft.AspNetCore.Mvc.Razor.IRazorViewEngine viewEngine, Microsoft.AspNetCore.Mvc.Razor.IRazorPageActivator pageActivator, System.Collections.Generic.IReadOnlyList viewStartPages, Microsoft.AspNetCore.Mvc.Razor.IRazorPage razorPage, System.Text.Encodings.Web.HtmlEncoder htmlEncoder)", + "Kind": "Removal" + }, + { + "TypeId": "public struct Microsoft.AspNetCore.Mvc.Razor.RazorPageFactoryResult", + "MemberId": "public .ctor(System.Collections.Generic.IList expirationTokens)", + "Kind": "Removal" + }, + { + "TypeId": "public struct Microsoft.AspNetCore.Mvc.Razor.RazorPageFactoryResult", + "MemberId": "public .ctor(System.Func razorPageFactory, System.Collections.Generic.IList expirationTokens)", + "Kind": "Removal" + }, + { + "TypeId": "public struct Microsoft.AspNetCore.Mvc.Razor.RazorPageFactoryResult", + "MemberId": "public System.Collections.Generic.IList get_ExpirationTokens()", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions", + "MemberId": "public Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions get_CompilationOptions()", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions", + "MemberId": "public Microsoft.CodeAnalysis.CSharp.CSharpParseOptions get_ParseOptions()", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions", + "MemberId": "public System.Void set_CompilationOptions(Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions value)", + "Kind": "Removal" + }, + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions", + "MemberId": "public System.Void set_ParseOptions(Microsoft.CodeAnalysis.CSharp.CSharpParseOptions value)", + "Kind": "Removal" + }, + { + "TypeId": "public sealed class Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate : System.MulticastDelegate", + "MemberId": "public virtual System.IAsyncResult BeginInvoke(System.IO.TextWriter writer, System.AsyncCallback callback, System.Object object)", + "Kind": "Removal" + }, + { + "TypeId": "public sealed class Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate : System.MulticastDelegate", + "MemberId": "public virtual System.Threading.Tasks.Task Invoke(System.IO.TextWriter writer)", + "Kind": "Removal" + } +]