Commit 480538b2 authored by Shai Szulanski's avatar Shai Szulanski Committed by Facebook GitHub Bot

Add test for coro::timeout on final asyncgenerator result

Summary: This was broken before D29680441 (https://github.com/facebook/folly/commit/832f135adede09d6e83e1f026c159d1b88249951)

Reviewed By: afernandez90

Differential Revision: D29913022

fbshipit-source-id: 5fa370a0ec3285875073ee84898601a41fff55e2
parent 8067a256
...@@ -179,6 +179,11 @@ TEST(Timeout, AsyncGenerator) { ...@@ -179,6 +179,11 @@ TEST(Timeout, AsyncGenerator) {
.next(), .next(),
1s)); 1s));
EXPECT_TRUE(tryResult.hasException<std::runtime_error>()); EXPECT_TRUE(tryResult.hasException<std::runtime_error>());
// Generator completing normally.
result = co_await coro::timeout(
[]() -> coro::AsyncGenerator<int> { co_return; }().next(), 1s);
EXPECT_FALSE(result);
}()); }());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment