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

Function TEST

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

Source from the content-addressed store, hash-verified

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