Skip to content

Commit 9802c05

Browse files
test fix
1 parent 820fae0 commit 9802c05

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dotnet/test/Azure.Iot.Operations.Protocol.UnitTests/Chunking/ChunkingMqttClientTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public async Task PublishAsync_LargeMessage_ChunksMessageAndSendsMultipleMessage
8383
.Callback<MqttApplicationMessage, CancellationToken>((msg, _) => publishedMessages.Add(msg))
8484
.ReturnsAsync(mqttClientPublishResult);
8585

86-
// Set a small max packet size to force chunking
87-
var maxPacketSize = 1000;
86+
var maxPacketSize = 64 * 1024;
8887
var connectResult = new MqttClientConnectResult
8988
{
9089
IsSessionPresent = true,
@@ -98,15 +97,15 @@ public async Task PublishAsync_LargeMessage_ChunksMessageAndSendsMultipleMessage
9897
var options = new ChunkingOptions
9998
{
10099
Enabled = true,
101-
StaticOverhead = 100,
100+
StaticOverhead = 500,
102101
ChecksumAlgorithm = ChunkingChecksumAlgorithm.SHA256
103102
};
104103

105104
var client = new ChunkingMqttPubSubClient(mockInnerClient.Object, options);
106105

107106
// Create a large message that needs chunking
108107
// The max chunk size will be maxPacketSize - staticOverhead = 900 bytes
109-
var largePayloadSize = 2500; // This should create 3 chunks
108+
var largePayloadSize = 2 * 64 * 1024; // This should create 3 chunks
110109
var largePayload = new byte[largePayloadSize];
111110
// Fill with identifiable content for later verification
112111
for (var i = 0; i < largePayloadSize; i++) largePayload[i] = (byte)(i % 256);

0 commit comments

Comments
 (0)