Skip to content

Commit 101ca7a

Browse files
committed
test(pubsub): annotate deferred-RunAsync drains (mirror #4327)
Use the same own-line `// RunAsync` marker convention as the bigtable MutationBatcher deadlock fix (#4327) so the deferred-continuation drains are immediately recognizable as the same idiom.
1 parent 223ceba commit 101ca7a

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

google/cloud/pubsub/internal/subscription_lease_management_test.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ TEST(SubscriptionLeaseManagementTest, NormalLifecycle) {
109109
// will verify that only the remaining messages have their lease extended.
110110
uut->AckMessage("ack-0-1");
111111
fake_cq->SimulateCompletion(true);
112-
fake_cq->SimulateCompletion(true); // drain the deferred OnRefreshTimer
112+
// RunAsync, drain the deferred OnRefreshTimer
113+
fake_cq->SimulateCompletion(true);
113114
ASSERT_EQ(1U, fake_cq->size());
114115

115116
// Ack one more message and trigger the new timer.
116117
uut->NackMessage("ack-0-2");
117118
fake_cq->SimulateCompletion(true);
118-
fake_cq->SimulateCompletion(true); // drain the deferred OnRefreshTimer
119+
// RunAsync, drain the deferred OnRefreshTimer
120+
fake_cq->SimulateCompletion(true);
119121
ASSERT_EQ(1U, fake_cq->size());
120122

121123
shutdown_manager->MarkAsShutdown(__func__, Status{});
@@ -223,7 +225,8 @@ TEST(SubscriptionLeaseManagementTest, UsesDeadlineExtension) {
223225

224226
// Ignore message and then fire the timer. This will extend the deadline.
225227
fake_cq->SimulateCompletion(true);
226-
fake_cq->SimulateCompletion(true); // drain the deferred OnRefreshTimer
228+
// RunAsync, drain the deferred OnRefreshTimer
229+
fake_cq->SimulateCompletion(true);
227230
ASSERT_EQ(1U, fake_cq->size());
228231

229232
shutdown_manager->MarkAsShutdown(__func__, Status{});
@@ -276,7 +279,8 @@ TEST(SubscriptionLeaseManagementTest, ExpiredMessage) {
276279
// will verify that only the remaining messages have their lease extended.
277280
uut->AckMessage("ack-0-1");
278281
fake_cq->SimulateCompletion(true);
279-
fake_cq->SimulateCompletion(true); // drain the deferred OnRefreshTimer
282+
// RunAsync, drain the deferred OnRefreshTimer
283+
fake_cq->SimulateCompletion(true);
280284
ASSERT_EQ(1U, fake_cq->size());
281285

282286
shutdown_manager->MarkAsShutdown(__func__, Status{});

0 commit comments

Comments
 (0)