Skip to content

tests.system.test_system.TestLogging: test_api_equality_list_logs failed #715

Closed
@flaky-bot

Description

@flaky-bot

Note: #662 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: dc1f681
buildURL: Build Status, Sponge
status: failed

Test output
self = 
@skip_for_mtls
def test_api_equality_list_logs(self):
    import google.cloud.logging_v2

    # Skip diagnostic log for this system test
    google.cloud.logging_v2._instrumentation_emitted = True

    unique_id = uuid.uuid1()
    gapic_logger = Config.CLIENT.logger(f"api-list-{unique_id}")
    http_logger = Config.HTTP_CLIENT.logger(f"api-list-{unique_id}")
    # write logs
    log_count = 5
    for i in range(log_count):
        gapic_logger.log_text(f"test {i}")

    def retryable():
        max_results = 3
        gapic_generator = gapic_logger.list_entries(max_results=max_results)
        http_generator = http_logger.list_entries(max_results=max_results)
        # returned objects should be consistent
        self.assertEqual(type(gapic_generator), type(http_generator))
        gapic_list, http_list = list(gapic_generator), list(http_generator)
        # max_results should limit the number of logs returned
        self.assertEqual(len(gapic_list), max_results)
        self.assertEqual(len(http_list), max_results)
        # returned logs should be the same
        self.assertEqual(gapic_list[0].insert_id, http_list[0].insert_id)
        # should return in ascending order
        self.assertEqual(gapic_list[0].payload, "test 0")
        # test reverse ordering
        gapic_generator = gapic_logger.list_entries(
            max_results=max_results, order_by=google.cloud.logging_v2.DESCENDING
        )
        http_generator = http_logger.list_entries(
            max_results=max_results, order_by=google.cloud.logging_v2.DESCENDING
        )
        gapic_list, http_list = list(gapic_generator), list(http_generator)
        self.assertEqual(len(gapic_list), max_results)
        self.assertEqual(len(http_list), max_results)
        # http and gapic results should be consistent
        self.assertEqual(gapic_list[0].insert_id, http_list[0].insert_id)
        # returned logs should be in descending order
        self.assertEqual(gapic_list[0].payload, f"test {log_count-1}")
  RetryErrors(
        (ServiceUnavailable, InternalServerError, AssertionError),
        delay=2,
        backoff=2,
        max_tries=3,
    )(retryable)()

tests/system/test_system.py:933:


.nox/system-3-8/lib/python3.8/site-packages/test_utils/retry.py:115: in wrapped_function
return to_wrap(*args, **kwargs)
tests/system/test_system.py:917: in retryable
self.assertEqual(gapic_list[0].payload, "test 0")
E AssertionError: 'test 1' != 'test 0'
E - test 1
E ? ^
E + test 0
E ? ^

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/python-logging API.flakybot: flakyTells the Flaky Bot not to close or comment on this issue.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions