Skip to content

Commit ed727dd

Browse files
glbrnttLukasa
authored andcommitted
Update perf test precondition (grpc#1545)
Motivation: A change made in grpc#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. Co-authored-by: Cory Benfield <[email protected]>
1 parent 213228a commit ed727dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/GRPCPerformanceTests/Benchmarks/EmbeddedClientThroughput.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ class EmbeddedClientThroughput: Benchmark {
108108
while let _ = try channel.readOutbound(as: HTTP2Frame.FramePayload.self) {
109109
requestFrames += 1
110110
}
111-
precondition(requestFrames == 3) // headers, data, empty data (end-stream)
111+
// headers, data, empty data (end-stream). If the request is large there may be
112+
// two DATA frames.
113+
precondition(
114+
requestFrames == 3 || requestFrames == 4,
115+
"Expected 3/4 HTTP/2 frames but got \(requestFrames)"
116+
)
112117

113118
// Okay, let's build a response.
114119

0 commit comments

Comments
 (0)