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

Function TEST

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

Source from the content-addressed store, hash-verified

268 ::testing::Values(false, true));
269
270TEST(SerialExecutor, AsyncGenerator) {
271 std::vector<TestInt> values{1, 2, 3, 4, 5};
272 auto source = util::SlowdownABit(util::AsyncVectorIt(values));
273 Iterator<TestInt> iter =
274 SerialExecutor::IterateGenerator<TestInt>([&source](Executor* executor) {
275 return MakeMappedGenerator(source, [executor](const TestInt& ti) {
276 return DeferNotOk(executor->Submit([ti] { return ti; }));
277 });
278 });
279 ASSERT_OK_AND_ASSIGN(auto vec, iter.ToVector());
280 ASSERT_EQ(vec, values);
281}
282
283TEST(SerialExecutor, AsyncGeneratorWithFollowUp) {
284 // 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