From b98eb13d4b7fa3a8176b3874e94397be8b3ad5e8 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 3 Jan 2023 17:13:45 +0000 Subject: [PATCH] Update perf test precondition Motivation: A change made in #1529 allowed multiple DATA frames to be emitted for a single message. One of the perf tests preconditions on there being exactly one DATA frame per message which is no longer the case. Modifications: - Update the precondition Result: Perf test does not crash. --- .../Benchmarks/EmbeddedClientThroughput.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift b/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift index 45d71cf34..e3369b9f8 100644 --- a/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift +++ b/Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift @@ -108,7 +108,12 @@ class EmbeddedClientThroughput: Benchmark { while let _ = try channel.readOutbound(as: HTTP2Frame.FramePayload.self) { requestFrames += 1 } - precondition(requestFrames == 3) // headers, data, empty data (end-stream) + // headers, data, empty data (end-stream). If the request is large there may be + // two DATA frames. + precondition( + requestFrames == 3 || requestFrames == 4, + "Expected 3/4 HTTP/2 frames but got \(requestFrames)" + ) // Okay, let's build a response.