Make some tests Flaky (#9935)

Mark some tests flaky.
This commit is contained in:
Ryan Brandenburg 2019-05-06 15:33:02 -07:00 committed by GitHub
parent bbf7ed2907
commit 8fd86c38db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 4 deletions

View File

@ -11,6 +11,7 @@ using System.Net.Http;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
using Xunit.Abstractions;
@ -55,7 +56,7 @@ namespace Microsoft.AspNetCore.Identity.Test
using (var alg384 = SHA384.Create())
{
byte[] hash;
if(isSha256)
if (isSha256)
{
hash = alg256.ComputeHash(respStream);
}
@ -79,6 +80,7 @@ namespace Microsoft.AspNetCore.Identity.Test
[Theory]
[MemberData(nameof(ScriptWithFallbackSrcData))]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2267", FlakyOn.AzP.macOS)]
public async Task IdentityUI_ScriptTags_FallbackSourceContent_Matches_CDNContent(ScriptTag scriptTag)
{
var slnDir = GetSolutionDir();

View File

@ -8,6 +8,8 @@ using Templates.Test.Helpers;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
namespace Templates.Test
{
@ -27,6 +29,7 @@ namespace Templates.Test
[Theory]
[InlineData(null)]
[InlineData("F#")]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2267", FlakyOn.All)]
public async Task MvcTemplate_NoAuthImplAsync(string languageOverride)
{
Project = await ProjectFactory.GetOrCreateProject("mvcnoauth" + (languageOverride == "F#" ? "fsharp" : "csharp"), Output);
@ -58,7 +61,7 @@ namespace Templates.Test
PageUrls.PrivacyFullUrl
};
if(languageOverride == null)
if (languageOverride == null)
{
menuLinks = menuLinks.Append(PageUrls.PrivacyFullUrl);
}
@ -100,6 +103,7 @@ namespace Templates.Test
[Theory]
[InlineData(true)]
[InlineData(false)]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2267", FlakyOn.All)]
public async Task MvcTemplate_IndividualAuthImplAsync(bool useLocalDB)
{
Project = await ProjectFactory.GetOrCreateProject("mvcindividual" + (useLocalDB ? "uld" : ""), Output);

View File

@ -5,6 +5,8 @@ using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.E2ETesting;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using OpenQA.Selenium;
using Templates.Test.Helpers;
using Xunit;
@ -24,6 +26,7 @@ namespace Templates.Test
public Project Project { get; private set; }
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2407", FlakyOn.AzP.Windows)]
public async Task RazorComponentsTemplateWorks()
{
Project = await ProjectFactory.GetOrCreateProject("blazorserverside", Output);

View File

@ -4,6 +4,8 @@
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Templates.Test.Helpers;
using Xunit;
using Xunit.Abstractions;
@ -25,6 +27,7 @@ namespace Templates.Test
public ITestOutputHelper Output { get; }
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2327", FlakyOn.All)]
public async Task RazorPagesTemplate_NoAuthImplAsync()
{
Project = await ProjectFactory.GetOrCreateProject("razorpagesnoauth", Output);
@ -95,6 +98,7 @@ namespace Templates.Test
}
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2335", FlakyOn.All)]
[InlineData(false)]
[InlineData(true)]
public async Task RazorPagesTemplate_IndividualAuthImplAsync(bool useLocalDB)

View File

@ -3,6 +3,8 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.E2ETesting;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Templates.Test.Helpers;
using Xunit;
using Xunit.Abstractions;
@ -17,6 +19,7 @@ namespace Templates.Test.SpaTemplateTest
}
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2407", FlakyOn.AzP.Windows)]
public Task ReactReduxTemplate_Works_NetCore()
=> SpaTemplateImplAsync("reactredux", "reactredux", useLocalDb: false, usesAuth: false);
}

View File

@ -3,6 +3,8 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.E2ETesting;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Templates.Test.Helpers;
using Xunit;
using Xunit.Abstractions;
@ -21,6 +23,7 @@ namespace Templates.Test.SpaTemplateTest
=> SpaTemplateImplAsync("reactnoauth", "react", useLocalDb: false, usesAuth: false);
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2243", FlakyOn.All)]
public Task ReactTemplate_IndividualAuth_NetCore()
=> SpaTemplateImplAsync("reactindividual", "react", useLocalDb: false, usesAuth: true);

View File

@ -244,7 +244,9 @@ namespace Templates.Test.SpaTemplateTest
var entries = logs.GetLog(logKind);
var badEntries = entries.Where(e => new LogLevel[] { LogLevel.Warning, LogLevel.Severe }.Contains(e.Level));
badEntries = badEntries.Where(e => !e.Message.EndsWith("failed: WebSocket is closed before the connection is established."));
badEntries = badEntries.Where(e =>
!e.Message.Contains("failed: WebSocket is closed before the connection is established.")
&& !e.Message.Contains("[WDS] Disconnected!"));
Assert.True(badEntries.Count() == 0, "There were Warnings or Errors from the browser." + Environment.NewLine + string.Join(Environment.NewLine, badEntries));
}

View File

@ -66,6 +66,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
}
[ConditionalFact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2267", FlakyOn.All)]
public async Task Server_ShutdownDuringRequest_Success()
{
Task<string> responseTask;
@ -595,7 +596,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
private async Task<string> SendRequestAsync(string uri)
{
using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout } )
using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
{
return await client.GetStringAsync(uri);
}