Skip to content

Commit

Permalink
Fixed broken postgres tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSenn committed Dec 15, 2023
1 parent 4e9d5e4 commit 7735207
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ 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
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);
});

Expand All @@ -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()
Expand Down

0 comments on commit 7735207

Please sign in to comment.