Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: driver.wait raises timeout in tests with pytest.mark.now #545

Open
alex2211-put opened this issue Jan 15, 2025 · 0 comments
Open

bug: driver.wait raises timeout in tests with pytest.mark.now #545

alex2211-put opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@alex2211-put
Copy link
Contributor

Bug Report

YDB Python SDK version:

3.18.2

Environment

linux

Current behavior:
I'm running the local YDB in the tests. When I use "pytest.mark.now", the driver crashes due to a timeout. If I remove "pytest.mark.now", the driver can connect to the database without any issues.

Examples of errors in logs:

INFO RpcState(ListEndpoints, da910f59-4028-4d35-aeda-2d34a1c33590, localhost:46117): received error, <AioRpcError of RPC that terminated with:
	status = StatusCode.DEADLINE_EXCEEDED
	details = "Deadline Exceeded"
	debug_error_string = "UNKNOWN:Deadline Exceeded {created_time:"2025-01-14T18:32:40.4485154+03:00", grpc_status:4}"
>
DEBUG Failed to resolve endpoints for database /Root/local. Endpoint: "localhost:46117". Error details:
 Deadline exceeded on request

Expected behavior:

The driver connects to the database with and without "pytest.mark.now"

Steps to reproduce:

Related code:

import logging

import pytest
import ydb

logger = logging.getLogger(__name__)


@pytest.mark.now('2019-07-26T10:20:00+0000')
async def test_topic_creation(local_ydb):
    driver_config = ydb.DriverConfig(
        local_ydb.endpoint,
        local_ydb.database,
    )
    async with ydb.aio.Driver(driver_config) as driver:
        try:
            await driver.wait(timeout=10)
        except TimeoutError:
            logger.error('[YDB] Failed to connect to local YDB instance')
            logger.error('Last reported errors by discovery:')
            logger.error(driver.discovery_debug_details())
            raise
        topic_name = 'test_topic'
        await driver.topic_client.create_topic(topic_name)

Other information:

@alex2211-put alex2211-put added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant