Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
w1am committed Jan 8, 2025
1 parent d98910a commit d62b558
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ReSharper disable InconsistentNaming

using System.Net;
using Ductus.FluentDocker.Builders;
using Ductus.FluentDocker.Extensions;
Expand Down Expand Up @@ -71,10 +73,8 @@ protected KurrentPermanentFixture(ConfigureFixture configure) {
DefaultDeadline = Options.ClientSettings.DefaultDeadline
};

InterlockedBoolean WarmUpCompleted { get; } = new InterlockedBoolean();
SemaphoreSlim WarmUpGatekeeper { get; } = new(1, 1);

static readonly SemaphoreSlim ContainerSemaphore = new(1, 1);
InterlockedBoolean WarmUpCompleted { get; } = new InterlockedBoolean();
static readonly SemaphoreSlim WarmUpGatekeeper = new(1, 1);

public void CaptureTestRun(ITestOutputHelper outputHelper) {
var testRunId = Logging.CaptureLogs(outputHelper);
Expand All @@ -84,19 +84,13 @@ public void CaptureTestRun(ITestOutputHelper outputHelper) {
}

public async Task InitializeAsync() {
await ContainerSemaphore.WaitAsync();
await WarmUpGatekeeper.WaitAsync();

try {
await Service.Start();
EventStoreVersion = GetKurrentVersion();
EventStoreHasLastStreamPosition = (EventStoreVersion?.Major ?? int.MaxValue) >= 21;
// EventStoreHasLastStreamPosition = true;
} finally {
ContainerSemaphore.Release();
}

await WarmUpGatekeeper.WaitAsync();

try {
if (!WarmUpCompleted.CurrentValue) {
Logger.Warning("*** Warmup started ***");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ protected KurrentTemporaryFixture(ConfigureFixture configure) {
DefaultDeadline = Options.ClientSettings.DefaultDeadline
};

InterlockedBoolean WarmUpCompleted { get; } = new InterlockedBoolean();
SemaphoreSlim WarmUpGatekeeper { get; } = new(1, 1);
static readonly SemaphoreSlim ContainerSemaphore = new(1, 1);
InterlockedBoolean WarmUpCompleted { get; } = new InterlockedBoolean();
static readonly SemaphoreSlim WarmUpGatekeeper = new(1, 1);

public void CaptureTestRun(ITestOutputHelper outputHelper) {
var testRunId = Logging.CaptureLogs(outputHelper);
Expand All @@ -86,19 +85,13 @@ public void CaptureTestRun(ITestOutputHelper outputHelper) {
}

public async Task InitializeAsync() {
await ContainerSemaphore.WaitAsync();
await WarmUpGatekeeper.WaitAsync();

try {
await Service.Start();
EventStoreVersion = GetKurrentVersion();
EventStoreHasLastStreamPosition = (EventStoreVersion?.Major ?? int.MaxValue) >= 21;
// EventStoreHasLastStreamPosition = true;
} finally {
ContainerSemaphore.Release();
}

await WarmUpGatekeeper.WaitAsync();

try {
if (!WarmUpCompleted.CurrentValue) {
Logger.Warning("*** Warmup started ***");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using EventStore.Client;
using Kurrent.Client.Tests.TestNode;
using Kurrent.Client.Tests;

namespace Kurrent.Client.Tests;

Expand Down

0 comments on commit d62b558

Please sign in to comment.