westonpace commented on a change in pull request #11285:
URL: https://github.com/apache/arrow/pull/11285#discussion_r723674829



##########
File path: cpp/src/arrow/dataset/scanner_test.cc
##########
@@ -1025,13 +1035,20 @@ TEST_F(TestBackpressure, ScanBatchesUnordered) {
   EXPECT_OK_AND_ASSIGN(AsyncGenerator<EnumeratedRecordBatch> gen,
                        scanner->ScanBatchesUnorderedAsync());
   ASSERT_FINISHES_OK(gen());
+  // Wait for the thread pool to idle.  By this point the scanner should have 
paused itself
+  // This helps with timing on slower CI systems where there is only one core 
and the scanner
+  // might keep that core until it has scanned all the batches which never 
gives the sink a
+  // chance to report it is falling behind.
+  GetCpuThreadPool()->WaitForIdle();
+  DeliverAdditionalBatches();
 
   // The exact numbers may be imprecise due to threading but we should pretty 
quickly read
   // up to our backpressure limit and a little above.  We should not be able 
to go too far
   // above.
-  BusyWait(10, [&] { return TotalBatchesRead() >= kDefaultBackpressureHigh; });
+  ASSERT_TRUE(TotalBatchesRead() >= kDefaultBackpressureHigh);

Review comment:
       Fixed.




-- 
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