From b89d90e05cfd203dd24671c2f91cc8f949e97a85 Mon Sep 17 00:00:00 2001 From: Shai Szulanski Date: Fri, 14 Jun 2024 14:34:03 -0700 Subject: [PATCH] Fix async generator test Summary: Broken by D58483579 Reviewed By: ispeters Differential Revision: D58593845 fbshipit-source-id: 1c71575df8dd0c22a958ea5192a2d7fa3ff632a5 --- folly/experimental/coro/test/AsyncGeneratorTest.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/folly/experimental/coro/test/AsyncGeneratorTest.cpp b/folly/experimental/coro/test/AsyncGeneratorTest.cpp index 7119c1a77b8..a5a834b63a3 100644 --- a/folly/experimental/coro/test/AsyncGeneratorTest.cpp +++ b/folly/experimental/coro/test/AsyncGeneratorTest.cpp @@ -490,7 +490,11 @@ TEST(AsyncGenerator, YieldCoError) { co_yield "foo"; co_yield "bar"; co_yield folly::coro::co_error(SomeError{}); - CHECK(false); + // not enforced in opt mode yet so this code is reached in the + // EXPECT_DEBUG_DEATH line + if (folly::kIsDebug) { + ADD_FAILURE(); + } }(); auto item1 = co_await gen.next(); @@ -500,7 +504,7 @@ TEST(AsyncGenerator, YieldCoError) { try { (void)co_await gen.next(); - CHECK(false); + ADD_FAILURE(); } catch (const SomeError&) { }