diff --git a/cpp/src/arrow/acero/asof_join_node_test.cc b/cpp/src/arrow/acero/asof_join_node_test.cc index dad93f7063d4e..81bc3e774bc75 100644 --- a/cpp/src/arrow/acero/asof_join_node_test.cc +++ b/cpp/src/arrow/acero/asof_join_node_test.cc @@ -1518,11 +1518,15 @@ void TestBackpressure(BatchesMaker maker, int num_batches, int batch_size) { gate.ReleaseAllBatches(); ASSERT_FINISHES_OK_AND_ASSIGN(BatchesWithCommonSchema batches, batches_fut); - size_t total_resumed = 0; - for (const auto& counters : bp_counters) { - total_resumed += counters.resume_count; - } ASSERT_GE(total_resumed, 2); + // One of the inputs is gated. The other two will eventually be resumed by the asof + // join node + for (size_t i = 0; i < source_configs.size(); i++) { + const auto& counters = bp_counters[i]; + if (source_configs[i].is_gated) { + ASSERT_GE(counters.resume_count, 0) return false; + } + } } TEST(AsofJoinTest, BackpressureWithBatches) {