From 35bcee49bc8cf5e665bb61cd721c9608bc45dfbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Silveira?= Date: Thu, 2 Nov 2023 15:38:41 +0100 Subject: [PATCH] * isolated the shutdown node test --- .../MergeIndexesTests.cs | 4 ++-- .../ShutdownNodeAuthenticationTests.cs | 12 ++++++++++++ .../ShutdownNodeTests.cs | 8 +------- .../Fixtures/EventStoreFixture.cs | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 test/EventStore.Client.Operations.Tests/ShutdownNodeAuthenticationTests.cs diff --git a/test/EventStore.Client.Operations.Tests/MergeIndexesTests.cs b/test/EventStore.Client.Operations.Tests/MergeIndexesTests.cs index 57b73f0dc..c4cf7bfb0 100644 --- a/test/EventStore.Client.Operations.Tests/MergeIndexesTests.cs +++ b/test/EventStore.Client.Operations.Tests/MergeIndexesTests.cs @@ -1,7 +1,7 @@ namespace EventStore.Client.Operations.Tests; -public class @admin : IClassFixture { - public admin(ITestOutputHelper output, InsecureClientTestFixture fixture) => +public class MergeIndexesTests : IClassFixture { + public MergeIndexesTests(ITestOutputHelper output, InsecureClientTestFixture fixture) => Fixture = fixture.With(x => x.CaptureTestRun(output)); InsecureClientTestFixture Fixture { get; } diff --git a/test/EventStore.Client.Operations.Tests/ShutdownNodeAuthenticationTests.cs b/test/EventStore.Client.Operations.Tests/ShutdownNodeAuthenticationTests.cs new file mode 100644 index 000000000..4219f616d --- /dev/null +++ b/test/EventStore.Client.Operations.Tests/ShutdownNodeAuthenticationTests.cs @@ -0,0 +1,12 @@ +namespace EventStore.Client.Operations.Tests; + +public class ShutdownNodeAuthenticationTests : IClassFixture { + public ShutdownNodeAuthenticationTests(ITestOutputHelper output, InsecureClientTestFixture fixture) => + Fixture = fixture.With(x => x.CaptureTestRun(output)); + + InsecureClientTestFixture Fixture { get; } + + [Fact] + public async Task shutdown_without_credentials_throws() => + await Fixture.Operations.ShutdownAsync().ShouldThrowAsync(); +} \ No newline at end of file diff --git a/test/EventStore.Client.Operations.Tests/ShutdownNodeTests.cs b/test/EventStore.Client.Operations.Tests/ShutdownNodeTests.cs index 10b102e4c..4c73f52fa 100644 --- a/test/EventStore.Client.Operations.Tests/ShutdownNodeTests.cs +++ b/test/EventStore.Client.Operations.Tests/ShutdownNodeTests.cs @@ -1,5 +1,3 @@ -using FlakyTest.XUnit.Attributes; - namespace EventStore.Client.Operations.Tests; public class ShutdownNodeTests : IClassFixture { @@ -9,10 +7,6 @@ public ShutdownNodeTests(ITestOutputHelper output, InsecureClientTestFixture fix InsecureClientTestFixture Fixture { get; } [Fact] - public async Task shutdown_does_not_throw() => + public async Task shutdown_does_not_throw() => await Fixture.Operations.ShutdownAsync(userCredentials: TestCredentials.Root).ShouldNotThrowAsync(); - - [MaybeFixedFact(1)] - public async Task shutdown_without_credentials_throws() => - await Fixture.Operations.ShutdownAsync().ShouldThrowAsync(); } \ No newline at end of file diff --git a/test/EventStore.Client.Tests.Common/Fixtures/EventStoreFixture.cs b/test/EventStore.Client.Tests.Common/Fixtures/EventStoreFixture.cs index 001a0ef2f..c10543e36 100644 --- a/test/EventStore.Client.Tests.Common/Fixtures/EventStoreFixture.cs +++ b/test/EventStore.Client.Tests.Common/Fixtures/EventStoreFixture.cs @@ -112,11 +112,11 @@ async Task WarmUp() { } public async Task InitializeAsync() { - await Service.Start().ShouldNotThrowAsync(); + await Service.Start(); await WarmUp(); - await OnSetup().ShouldNotThrowAsync("Failed to run OnSetup!"); + await OnSetup(); } public async Task DisposeAsync() {