Add comments to packet coalescing test

pull/9247/head
Muxi Yan 8 years ago
parent 8e6aec5ed7
commit 1fb35b5348
  1. 6
      src/objective-c/tests/InteropTests.m

@ -164,11 +164,15 @@
expectedResponse.payload.body = [NSMutableData dataWithLength:10]; expectedResponse.payload.body = [NSMutableData dataWithLength:10];
XCTAssertEqualObjects(response, expectedResponse); XCTAssertEqualObjects(response, expectedResponse);
// The test is a success if there is a batch of exactly 3 ops (SEND_INITIAL_METADATA,
// SEND_MESSAGE, SEND_CLOSE_FROM_CLIENT). Without packet coalescing each batch of ops contains
// only one op.
NSArray *opBatches = [GRPCCall obtainAndCleanOpBatchLog]; NSArray *opBatches = [GRPCCall obtainAndCleanOpBatchLog];
const NSInteger kExpectedOpBatchSize = 3;
for (NSObject *o in opBatches) { for (NSObject *o in opBatches) {
if ([o isKindOfClass:[NSArray class]]) { if ([o isKindOfClass:[NSArray class]]) {
NSArray *batch = (NSArray *)o; NSArray *batch = (NSArray *)o;
if ([batch count] == 3) { if ([batch count] == kExpectedOpBatchSize) {
[expectation fulfill]; [expectation fulfill];
break; break;
} }

Loading…
Cancel
Save