tests.unit.gapic.orgpolicy_v2.test_org_policy: test_list_policies_async_pager failed
Closed this issue · 2 comments
This test failed!
To configure my behavior, see the Flaky Bot documentation.
If I'm commenting on this issue too often, add the flakybot: quiet
label and
I will stop commenting.
commit: 10b1667
buildURL: Build Status, Sponge
status: failed
Test output
@pytest.mark.asyncio async def test_list_policies_async_pager(): client = OrgPolicyAsyncClient( credentials=ga_credentials.AnonymousCredentials, )# Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.list_policies), "__call__", new_callable=mock.AsyncMock ) as call: # Set the response to a series of pages. call.side_effect = ( orgpolicy.ListPoliciesResponse( policies=[ orgpolicy.Policy(), orgpolicy.Policy(), orgpolicy.Policy(), ], next_page_token="abc", ), orgpolicy.ListPoliciesResponse( policies=[], next_page_token="def", ), orgpolicy.ListPoliciesResponse( policies=[ orgpolicy.Policy(), ], next_page_token="ghi", ), orgpolicy.ListPoliciesResponse( policies=[ orgpolicy.Policy(), orgpolicy.Policy(), ], ), RuntimeError, ) async_pager = await client.list_policies( request={}, ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6
assert all(isinstance(i, orgpolicy.Policy) for i in responses)
E assert False
E + where False = all(<generator object test_list_policies_async_pager.. at 0x7f661a032880>)tests/unit/gapic/orgpolicy_v2/test_org_policy.py:1416: AssertionError
Looks like this issue is flaky. 😟
I'm going to leave this open and stop commenting.
A human should fix and close this.
When run at the same commit (10b1667), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).
This error occurs with protobuf==4.21.0. See googleapis/gapic-generator-python#1328. I'm going to close this issue as we've already pinned to protobuf<4.x.x in a core dependency.