From f624c9aa7b3735f613ae059a26fe180f4155c89c Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 20 Aug 2018 12:01:09 -0700 Subject: [PATCH] Add flaky test logging for `CacheTagHelper_VaryByCultureComposesWithOtherVaryByOptions`. #8281 --- .../HtmlGenerationWithCultureTest.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs index 9b1d1f5cbe..d028f5ec24 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/HtmlGenerationWithCultureTest.cs @@ -6,9 +6,12 @@ using System.Net.Http; using System.Threading.Tasks; using AngleSharp.Dom; using AngleSharp.Dom.Html; +using AngleSharp.Extensions; +using AngleSharp.Html; using HtmlGenerationWebSite; using Microsoft.AspNetCore.Hosting; using Xunit; +using Xunit.Sdk; namespace Microsoft.AspNetCore.Mvc.FunctionalTests { @@ -149,6 +152,14 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests // Assert - 3 Assert.Equal("fr-FR", culture); Assert.Equal("14", correlationId); + + if (cachedCorrelationId != "10") + { + // This is logging to investigate potential flakiness in this test tracked by https://github.com/aspnet/Mvc/issues/8281 + var documentContent = document.ToHtml(new HtmlMarkupFormatter()); + throw new XunitException($"Unexpected correlation Id, reading values from document:{Environment.NewLine}{documentContent}"); + } + Assert.Equal("10", cachedCorrelationId); void ReadValuesFromDocument()