From 805d6fdb39da2a3e949c2d3ca8a3a2c3aeec4c82 Mon Sep 17 00:00:00 2001 From: JoannaaKL Date: Thu, 15 Sep 2022 19:17:22 +0000 Subject: [PATCH] remove test asserting thrown exception --- .../L0/Worker/ContainerOperationProviderL0.cs | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Test/L0/Worker/ContainerOperationProviderL0.cs b/src/Test/L0/Worker/ContainerOperationProviderL0.cs index 9cf97af51..81b71b116 100644 --- a/src/Test/L0/Worker/ContainerOperationProviderL0.cs +++ b/src/Test/L0/Worker/ContainerOperationProviderL0.cs @@ -12,7 +12,6 @@ using System; namespace GitHub.Runner.Common.Tests.Worker { - [Collection("Sequential")] public sealed class ContainerOperationProviderL0 { @@ -29,20 +28,6 @@ namespace GitHub.Runner.Common.Tests.Worker List containers = new List(); - [Fact] - [Trait("Level", "L0")] - [Trait("Category", "Worker")] - public async void RunServiceContainersHealthcheck_UnhealthyServiceContainer_AssertExceptionThrown() - { - //Arrange - Setup(); - _dockerManager.Setup(x => x.DockerInspect(_ec.Object, It.IsAny(), It.IsAny())).Returns(Task.FromResult(unhealthyDockerStatus)); - - //Act and Assert - await Assert.ThrowsAsync(() => containerOperationProvider.RunContainersHealthcheck(_ec.Object, containers)); - - } - [Fact] [Trait("Level", "L0")] [Trait("Category", "Worker")] @@ -58,11 +43,11 @@ namespace GitHub.Runner.Common.Tests.Worker await containerOperationProvider.RunContainersHealthcheck(_ec.Object, containers); } - catch (InvalidOperationException) { } - + catch (InvalidOperationException) { + //Assert Assert.Equal(TaskResult.Failed, _ec.Object.Result ?? TaskResult.Failed); - + } } [Fact]