@@ -134,10 +134,11 @@ TEST_F(KeyBasedBatchingTest, testSequenceId) {
134134 sendAsync (" B" , " 3" );
135135 sendAsync (" C" , " 4" );
136136 sendAsync (" A" , " 5" );
137- // sequence id: B < C < A, so there are 3 batches in order as following:
137+ // Batches are sent in ascending order of the first message's sequence id (BatchMessageKeyBasedContainer
138+ // sorts by sendArgs->sequenceId). Send order gives A=0, B=1, C=2 for first per key, so batches: A, B, C.
139+ // A: 0, 5
138140 // B: 1, 3
139141 // C: 2, 4
140- // A: 0, 5
141142 latch.wait ();
142143
143144 std::vector<std::string> receivedKeys;
@@ -149,8 +150,8 @@ TEST_F(KeyBasedBatchingTest, testSequenceId) {
149150 receivedValues.emplace_back (msg.getDataAsString ());
150151 }
151152
152- decltype (receivedKeys) expectedKeys{" B " , " B " , " C " , " C " , " A " , " A " };
153- decltype (receivedValues) expectedValues{" 1 " , " 3 " , " 2 " , " 4 " , " 0 " , " 5 " };
153+ decltype (receivedKeys) expectedKeys{" A " , " A " , " B " , " B " , " C " , " C " };
154+ decltype (receivedValues) expectedValues{" 0 " , " 5 " , " 1 " , " 3 " , " 2 " , " 4 " };
154155 EXPECT_EQ (receivedKeys, expectedKeys);
155156 EXPECT_EQ (receivedValues, expectedValues);
156157}
0 commit comments