aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/util/executor_test.cc
diff options
context:
space:
mode:
authorGravatar Konstantin Varlamov <var-const@users.noreply.github.com>2018-05-10 19:18:22 -0400
committerGravatar GitHub <noreply@github.com>2018-05-10 19:18:22 -0400
commit8cde81689dcfc74c9b59e088bbe00f95ca4bf68d (patch)
tree94c8bb8874ab756e79ffa9c63d335d3ffc513fec /Firestore/core/test/firebase/firestore/util/executor_test.cc
parentc7667229e2ab35d14fa7855789ee0584a2f8e817 (diff)
Firestore C++: quick fix for flaky tests in AsyncQueue and Executor (#1245)
Diffstat (limited to 'Firestore/core/test/firebase/firestore/util/executor_test.cc')
-rw-r--r--Firestore/core/test/firebase/firestore/util/executor_test.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/Firestore/core/test/firebase/firestore/util/executor_test.cc b/Firestore/core/test/firebase/firestore/util/executor_test.cc
index e277786..99bddce 100644
--- a/Firestore/core/test/firebase/firestore/util/executor_test.cc
+++ b/Firestore/core/test/firebase/firestore/util/executor_test.cc
@@ -66,15 +66,19 @@ TEST_P(ExecutorTest, DestructorDoesNotBlockIfThereArePendingTasks) {
ABORT_ON_TIMEOUT(future);
}
+// TODO(varconst): this test is inherently flaky because it can't be guaranteed
+// that the enqueued asynchronous operation didn't finish before the code has
+// a chance to even enqueue the next operation. Delays are chosen so that the
+// test is unlikely to fail in practice. Need to revisit this.
TEST_P(ExecutorTest, CanScheduleOperationsInTheFuture) {
std::string steps;
executor->Execute([&steps] { steps += '1'; });
- Schedule(executor.get(), Executor::Milliseconds(5), [&] {
+ Schedule(executor.get(), Executor::Milliseconds(20), [&] {
steps += '4';
signal_finished();
});
- Schedule(executor.get(), Executor::Milliseconds(1),
+ Schedule(executor.get(), Executor::Milliseconds(10),
[&steps] { steps += '3'; });
executor->Execute([&steps] { steps += '2'; });