You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/20 13:56:24 UTC

[GitHub] [arrow] westonpace commented on a diff in pull request #13651: ARROW-17087: [C++] Race condition in scanner test

westonpace commented on code in PR #13651:
URL: https://github.com/apache/arrow/pull/13651#discussion_r925639943


##########
cpp/src/arrow/util/future_test.cc:
##########
@@ -526,6 +527,23 @@ TEST(FutureStressTest, TryAddCallback) {
   }
 }
 
+TEST(FutureStressTest, DeleteAfterWait) {
+  constexpr int kNumTasks = 100;
+  for (int i = 0; i < kNumTasks; i++) {
+    {
+      std::unique_ptr<Future<>> future =
+          internal::make_unique<Future<>>(Future<>::Make());
+      std::thread t([&]() {
+        SleepABit();
+        future->MarkFinished();
+      });
+      ASSERT_TRUE(future->Wait(100));

Review Comment:
   In most cases this wait will only be micro/milli seconds.  However, the CI machines have a tendency to hang for seconds at a time without yielding and I don't see any real advantage in cutting it close.  I will change it to `arrow::kDefaultAssertFinishesWaitSeconds` which is 64 but maybe a bit more clearly named.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org