From aacb7d7453ccfdd76af598079f685131dea94282 Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Wed, 25 Jan 2017 11:00:31 -0800 Subject: [PATCH] Fix flaky tests. --- .../EngineTests.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs b/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs index 1c9eefb324..5a6dc3ddb4 100644 --- a/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs +++ b/test/Microsoft.AspNetCore.Server.KestrelTests/EngineTests.cs @@ -832,12 +832,14 @@ namespace Microsoft.AspNetCore.Server.KestrelTests "", ""); - Assert.Equal(2, onStartingCallCount1); - // The second OnStarting callback should not be called since the first failed. - Assert.Equal(0, onStartingCallCount2); - Assert.Equal(2, testLogger.ApplicationErrorsLogged); + } } + + Assert.Equal(2, onStartingCallCount1); + // The second OnStarting callback should not be called since the first failed. + Assert.Equal(0, onStartingCallCount2); + Assert.Equal(2, testLogger.ApplicationErrorsLogged); } [Theory] @@ -882,12 +884,12 @@ namespace Microsoft.AspNetCore.Server.KestrelTests "", "Hello World"); } - - // All OnCompleted callbacks should be called even if they throw. - Assert.Equal(2, testLogger.ApplicationErrorsLogged); - Assert.True(onCompletedCalled1); - Assert.True(onCompletedCalled2); } + + // All OnCompleted callbacks should be called even if they throw. + Assert.Equal(2, testLogger.ApplicationErrorsLogged); + Assert.True(onCompletedCalled1); + Assert.True(onCompletedCalled2); } [Theory]