| 885 | }; |
| 886 | |
| 887 | TEST_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 | |
| 905 | TEST_F(MergedGeneratorErrorHookTest, OuterErrorNotLostToConcurrentPull) { |
| 906 | auto failing = Future<AsyncGenerator<TestInt>>::Make(); |
nothing calls this directly
no test coverage detected