rtpsw commented on code in PR #35874:
URL: https://github.com/apache/arrow/pull/35874#discussion_r1214471386


##########
cpp/src/arrow/acero/asof_join_node_test.cc:
##########
@@ -1406,6 +1477,20 @@ void TestBackpressure(BatchesMaker maker, int 
num_batches, int batch_size,
     total_length += batch->num_rows();
   }
   ASSERT_EQ(static_cast<int64_t>(num_batches * batch_size), total_length);
+
+  std::unordered_map<bool, BackpressureCounters> counters_by_is_fast;
+  for (size_t i = 0; i < source_configs.size(); i++) {
+    BackpressureCounters& counters = 
counters_by_is_fast[source_configs[i].is_fast];
+    counters.pause_count += bp_counters[i].pause_count;
+    counters.resume_count += bp_counters[i].resume_count;
+  }
+  ASSERT_EQ(counters_by_is_fast.size(), 2);
+  ASSERT_GT(counters_by_is_fast[true].pause_count, 0);
+  ASSERT_GT(counters_by_is_fast[true].resume_count, 0);
+  // runs on some slow machines may not see any pause/resume, but if at least 
one pause is
+  // seen then at least one resume must also be seen
+  ASSERT_EQ(counters_by_is_fast[false].pause_count > 0,

Review Comment:
   I think we do. My understanding is that the intention of the pre-PR test 
code was to drive the as-of-join slower using a slower input to it, which 
should lead to backpressure from the as-of-join node toward a faster source. 
The additional intention of the post-PR test code is to check that indeed this 
backpressure happens, and this is observed at the test nodes inserted after 
each source.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to