diff --git a/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/PostgresChannelWriterTests.cs b/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/PostgresChannelWriterTests.cs index d6c9a176100..4be53763d5f 100644 --- a/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/PostgresChannelWriterTests.cs +++ b/src/HotChocolate/Core/test/Subscriptions.Postgres.Tests/PostgresChannelWriterTests.cs @@ -50,15 +50,12 @@ public async Task SendAsync_Should_WriteMessageToChannel_When_CalledWithValidInp Assert.Equal("dGVzdA==:test", result[25..]); } -#if DEBUG - [Fact] // TODO: This test needs to be fixed + [Fact] public async Task SendAsync_Should_WriteManyMessage_When_CalledManyTimes() { // Arrange var postgresChannelWriter = new PostgresChannelWriter(_events, _options); await postgresChannelWriter.Initialize(CancellationToken.None); - var message = - PostgresMessageEnvelope.Create("test", "test", _options.MaxMessagePayloadSize); var testChannel = new TestChannel(SyncConnectionFactory, _channelName); // Act @@ -66,6 +63,9 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 1000), new ParallelOptions { MaxDegreeOfParallelism = 10 }, async (_, _) => { + var message = + PostgresMessageEnvelope.Create("test", "test", _options.MaxMessagePayloadSize); + await postgresChannelWriter.SendAsync(message, CancellationToken.None); }); @@ -77,7 +77,6 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 1000), Assert.Equal(1000, testChannel.ReceivedMessages.Count); } -#endif [Fact] public async Task Initialize_Should_InitializeResilientNpgsqlConnection_When_Called()