From 205cf5a58dfc1e87940b3c0a6b44d23dbc028578 Mon Sep 17 00:00:00 2001 From: Jonas Gottschau Date: Wed, 30 Oct 2024 20:35:34 +0100 Subject: [PATCH] fix test container not using replicasets (#415) --- src/Hangfire.Mongo.Tests/Utils/MongoDbFixture.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hangfire.Mongo.Tests/Utils/MongoDbFixture.cs b/src/Hangfire.Mongo.Tests/Utils/MongoDbFixture.cs index 882f432..3391194 100644 --- a/src/Hangfire.Mongo.Tests/Utils/MongoDbFixture.cs +++ b/src/Hangfire.Mongo.Tests/Utils/MongoDbFixture.cs @@ -17,6 +17,7 @@ public sealed class MongoIntegrationTestFixture : IAsyncLifetime public readonly MongoDbContainer MongoDbContainer = new MongoDbBuilder() .WithImage("mongo:7.0") + .WithReplicaSet() .Build(); public string MongoConnectionString { get; private set; } @@ -24,8 +25,7 @@ public sealed class MongoIntegrationTestFixture : IAsyncLifetime public async Task InitializeAsync() { await MongoDbContainer.StartAsync(); - - MongoConnectionString = MongoDbContainer.GetConnectionString(); + MongoConnectionString = MongoDbContainer.GetConnectionString() + "?directConnection=true"; } public async Task DisposeAsync()