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

Function TEST_F

cpp/src/arrow/util/async_generator_test.cc:887–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885};
886
887TEST_F(MergedGeneratorErrorHookTest, InnerErrorNotLostToConcurrentPull) {
888 auto failing = Future<TestInt>::Make();
889 AsyncGenerator<TestInt> failing_sub = [failing]() { return failing; };
890 std::vector<AsyncGenerator<TestInt>> subs = {MakeVectorGenerator<TestInt>({TestInt(1)}),
891 failing_sub};
892 auto merged = MakeMergedGenerator(MakeVectorGenerator(std::move(subs)), 1);
893 // Delivers 1 and then subscribes to failing_sub, whose first item is pending. Now
894 // there is one outstanding request and nobody waiting.
895 ASSERT_FINISHES_OK_AND_EQ(TestInt(1), merged());
896
897 Future<TestInt> pulled;
898 PullFromErrorHook(&merged, &pulled);
899 failing.MarkFinished(Status::Invalid("XYZ"));
900 ASSERT_TRUE(pulled.is_valid());
901 ASSERT_FINISHES_AND_RAISES(Invalid, pulled);
902 AssertGeneratorExhausted(merged);
903}
904
905TEST_F(MergedGeneratorErrorHookTest, OuterErrorNotLostToConcurrentPull) {
906 auto failing = Future<AsyncGenerator<TestInt>>::Make();

Callers

nothing calls this directly

Calls 14

TestIntClass · 0.85
MakeMergedGeneratorFunction · 0.85
MakeVectorGeneratorFunction · 0.85
AssertGeneratorExhaustedFunction · 0.85
IsIterationEndFunction · 0.85
AssertFailedFunction · 0.85
push_backMethod · 0.80
MakeFunction · 0.70
ASSERT_OK_AND_ASSIGNFunction · 0.70
InvalidFunction · 0.50
MarkFinishedMethod · 0.45

Tested by

no test coverage detected