googleapis / python-game-servers

Apache License 2.0
11 stars 6 forks source link

tests.unit.gapic.gaming_v1beta.test_realms_service: test_list_realms_async_pager failed #322

Closed flaky-bot[bot] closed 2 years ago

flaky-bot[bot] commented 2 years ago

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: 7598cb6275b1a587ed6a1f63f3d209861f24a32e buildURL: Build Status, Sponge status: failed

Test output
@pytest.mark.asyncio
    async def test_list_realms_async_pager():
        client = RealmsServiceAsyncClient(
            credentials=ga_credentials.AnonymousCredentials,
        )

        # Mock the actual call within the gRPC stub, and fake the request.
        with mock.patch.object(
            type(client.transport.list_realms), "__call__", new_callable=mock.AsyncMock
        ) as call:
            # Set the response to a series of pages.
            call.side_effect = (
                realms.ListRealmsResponse(
                    realms=[
                        realms.Realm(),
                        realms.Realm(),
                        realms.Realm(),
                    ],
                    next_page_token="abc",
                ),
                realms.ListRealmsResponse(
                    realms=[],
                    next_page_token="def",
                ),
                realms.ListRealmsResponse(
                    realms=[
                        realms.Realm(),
                    ],
                    next_page_token="ghi",
                ),
                realms.ListRealmsResponse(
                    realms=[
                        realms.Realm(),
                        realms.Realm(),
                    ],
                ),
                RuntimeError,
            )
            async_pager = await client.list_realms(
                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, realms.Realm) for i in responses)
E           assert False
E            +  where False = all(. at 0x7f0642165150>)

tests/unit/gapic/gaming_v1beta/test_realms_service.py:1032: AssertionError
parthea commented 2 years ago

This error occurs with protobuf==4.21.0. See https://github.com/googleapis/gapic-generator-python/issues/1328. I'm going to close this issue as we've already pinned to protobuf<4.x.x in a core dependency.