MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/util/thread_pool_test.cc:268–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 ::testing::Values(false, true));
267
268TEST(SerialExecutor, AsyncGenerator) {
269 std::vector<TestInt> values{1, 2, 3, 4, 5};
270 auto source = util::SlowdownABit(util::AsyncVectorIt(values));
271 Iterator<TestInt> iter =
272 SerialExecutor::IterateGenerator<TestInt>([&source](Executor* executor) {
273 return MakeMappedGenerator(source, [executor](const TestInt& ti) {
274 return DeferNotOk(executor->Submit([ti] { return ti; }));
275 });
276 });
277 ASSERT_OK_AND_ASSIGN(auto vec, iter.ToVector());
278 ASSERT_EQ(vec, values);
279}
280
281TEST(SerialExecutor, AsyncGeneratorWithFollowUp) {
282 // Sometimes a task will generate follow-up tasks. These should be run

Callers

nothing calls this directly

Calls 15

SlowdownABitFunction · 0.85
AsyncVectorItFunction · 0.85
MakeMappedGeneratorFunction · 0.85
DeferNotOkFunction · 0.85
TestIntClass · 0.85
SleepABitFunction · 0.85
MakeTransferredGeneratorFunction · 0.85
AssertIteratorExhaustedFunction · 0.85
GetCpuThreadPoolFunction · 0.85
DelEnvVarFunction · 0.85
DefaultCapacityFunction · 0.85
SetEnvVarFunction · 0.85

Tested by

no test coverage detected