googleapis/python-memcache

tests.unit.gapic.memcache_v1.test_cloud_memcache: test_list_instances_async_pager failed

Closed this issue · 0 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: d6f5bfc
buildURL: Build Status, Sponge
status: failed

Test output
@pytest.mark.asyncio
    async def test_list_instances_async_pager():
        client = CloudMemcacheAsyncClient(
            credentials=ga_credentials.AnonymousCredentials,
        )
    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.list_instances), "__call__", new_callable=mock.AsyncMock
    ) as call:
        # Set the response to a series of pages.
        call.side_effect = (
            cloud_memcache.ListInstancesResponse(
                instances=[
                    cloud_memcache.Instance(),
                    cloud_memcache.Instance(),
                    cloud_memcache.Instance(),
                ],
                next_page_token="abc",
            ),
            cloud_memcache.ListInstancesResponse(
                instances=[],
                next_page_token="def",
            ),
            cloud_memcache.ListInstancesResponse(
                instances=[
                    cloud_memcache.Instance(),
                ],
                next_page_token="ghi",
            ),
            cloud_memcache.ListInstancesResponse(
                instances=[
                    cloud_memcache.Instance(),
                    cloud_memcache.Instance(),
                ],
            ),
            RuntimeError,
        )
        async_pager = await client.list_instances(
            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, cloud_memcache.Instance) for i in responses)

E assert False
E + where False = all(<generator object test_list_instances_async_pager.. at 0x7f1aea9b7f20>)

tests/unit/gapic/memcache_v1/test_cloud_memcache.py:1032: AssertionError