add FlakyAttribute to mark flaky tests (#1222)

part of aspnet/AspNetCore#8237
This commit is contained in:
Andrew Stanton-Nurse 2019-03-06 15:19:11 -08:00 committed by GitHub
parent e9fd9d7ab3
commit 52be71db2b
1 changed files with 8 additions and 0 deletions

View File

@ -91,6 +91,14 @@ namespace Microsoft.Extensions.Logging.Testing
public virtual void Dispose()
{
if(_testLog == null)
{
// It seems like sometimes the MSBuild goop that adds the test framework can end up in a bad state and not actually add it
// Not sure yet why that happens but the exception isn't clear so I'm adding this error so we can detect it better.
// -anurse
throw new InvalidOperationException("LoggedTest base class was used but nothing initialized it! The test framework may not be enabled. Try cleaning your 'obj' directory.");
}
_initializationException?.Throw();
_testLog.Dispose();
}