Skip to content

Commit

Permalink
Increase message count in end2end test
Browse files Browse the repository at this point in the history
  • Loading branch information
numinnex committed Oct 18, 2023
1 parent b69471b commit 00d8191
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Configurations;
using Iggy_SDK;
using Iggy_SDK.Contracts.Http;
using Iggy_SDK.Enums;
Expand All @@ -14,9 +15,10 @@ namespace Iggy_SDK_Tests.E2ETests.Fixtures.Tcp;

public sealed class IggyTcpFetchMessagesFixture : IAsyncLifetime
{
private readonly IContainer _container = new ContainerBuilder().WithImage("iggyrs/iggy:latest")
public readonly IContainer _container = new ContainerBuilder().WithImage("iggyrs/iggy:latest")
//.WithPortBinding(3000, true)
.WithPortBinding(8090, true)
.WithOutputConsumer(Consume.RedirectStdoutAndStderrToConsole())
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(8090))
//.WithPortBinding(8080, true)
.Build();
Expand Down Expand Up @@ -65,11 +67,11 @@ await sut.LoginUser(new LoginUserRequest

var request = MessageFactory.CreateMessageSendRequest(
StreamRequest.StreamId, TopicRequest.TopicId, PartitionId,
MessageFactory.GenerateMessages(20));
MessageFactory.GenerateMessages(1000000));

var requestWithHeaders = MessageFactory.CreateMessageSendRequest(
StreamRequest.StreamId, HeadersTopicRequest.TopicId, PartitionId,
MessageFactory.GenerateMessages(20, MessageFactory.GenerateMessageHeaders(6)));
MessageFactory.GenerateMessages(1000000, MessageFactory.GenerateMessageHeaders(6)));
await sut.SendMessagesAsync(request);
await sut.SendMessagesAsync(requestWithHeaders);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ namespace Iggy_SDK_Tests.E2ETests.Fixtures.Tcp;

public sealed class IggyTcpPollMessagesFixture : IAsyncLifetime
{
private readonly IContainer _container = new ContainerBuilder().WithImage("iggyrs/iggy:latest")
public readonly IContainer _container = new ContainerBuilder().WithImage("iggyrs/iggy:latest")
//.WithPortBinding(3000, true)
.WithPortBinding(8090, true)
.WithOutputConsumer(Consume.RedirectStdoutAndStderrToConsole())
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(8090))
//.WithPortBinding(8080, true)
.Build();
Expand All @@ -29,7 +30,7 @@ public sealed class IggyTcpPollMessagesFixture : IAsyncLifetime
private static readonly StreamRequest StreamRequest = StreamFactory.CreateStreamRequest();
private static readonly TopicRequest TopicRequest = TopicFactory.CreateTopicRequest();
private static readonly TopicRequest HeadersTopicRequest = TopicFactory.CreateTopicRequest();
public const int MessageCount = 1000;
public const int MessageCount = 1000000;

public readonly int StreamId = StreamRequest.StreamId;
public readonly int TopicId = TopicRequest.TopicId;
Expand Down Expand Up @@ -82,7 +83,7 @@ await sut.SendMessagesAsync(new MessageSendRequest<DummyMessage>
},
MessageFactory.Serializer,
headers: MessageFactory.GenerateMessageHeaders(HeadersCount));
//await Task.Delay(2500);
await Task.Delay(2500);
}

public async Task DisposeAsync()
Expand Down
8 changes: 5 additions & 3 deletions Iggy_SDK_Tests/E2ETests/Messaging/FetchMessagesE2ETcp.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using DotNet.Testcontainers.Builders;
using FluentAssertions;
using Iggy_SDK.Contracts.Http;
using Iggy_SDK.Enums;
Expand All @@ -6,6 +7,7 @@
using Iggy_SDK_Tests.Utils;
using Iggy_SDK_Tests.Utils.DummyObj;
using Iggy_SDK_Tests.Utils.Messages;
using Xunit.Abstractions;

namespace Iggy_SDK_Tests.E2ETests.Messaging;

Expand All @@ -21,11 +23,11 @@ public FetchMessagesE2ETcp(IggyTcpFetchMessagesFixture fixture)
{
_fixture = fixture;
_messageFetchRequest =
MessageFactory.CreateMessageFetchRequestConsumer(10, _fixture.StreamId, _fixture.TopicId, _fixture.PartitionId);
MessageFactory.CreateMessageFetchRequestConsumer(10000, _fixture.StreamId, _fixture.TopicId, _fixture.PartitionId);
_headersMessageFetchRequest =
MessageFactory.CreateMessageFetchRequestConsumer(10, _fixture.StreamId, _fixture.HeadersTopicId, _fixture.PartitionId);
MessageFactory.CreateMessageFetchRequestConsumer(10000, _fixture.StreamId, _fixture.HeadersTopicId, _fixture.PartitionId);
_invalidFetchRequest =
MessageFactory.CreateMessageFetchRequestConsumer(10, _fixture.InvalidStreamId, _fixture.InvalidTopicId, _fixture.PartitionId);
MessageFactory.CreateMessageFetchRequestConsumer(10000, _fixture.InvalidStreamId, _fixture.InvalidTopicId, _fixture.PartitionId);
}

[Fact, TestPriority(1)]
Expand Down

0 comments on commit 00d8191

Please sign in to comment.