Skip to content

fix testsuite: fix YDB startup scripts - #1306

Open
lemito wants to merge 5 commits into
userver-framework:developfrom
lemito:ydb_fix
Open

fix testsuite: fix YDB startup scripts#1306
lemito wants to merge 5 commits into
userver-framework:developfrom
lemito:ydb_fix

Conversation

@lemito

@lemito lemito commented Jul 29, 2026

Copy link
Copy Markdown

YDB fails to create the database when running tests, which causes goose migrations to fail. Added a time limit for YDB to start, after which the tests are run.
The migration database schema has also been replaced for the basic functional test.

lemito added 2 commits July 29, 2026 15:57
YDB fails to create the database when running tests, which causes goose migrations to fail. Added a time limit for YDB to start, after which the tests are run
@lemito
lemito marked this pull request as draft July 29, 2026 13:54
@lemito
lemito marked this pull request as ready for review July 29, 2026 13:54
@lemito
lemito marked this pull request as draft July 29, 2026 13:54
@lemito
lemito marked this pull request as ready for review July 29, 2026 13:55
mon_port=pytestconfig.option.ydb_mon_port,
ic_port=pytestconfig.option.ydb_ic_port,
database=database,
wait_time=pytestconfig.option.ydb_wait_time,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something, or is --ydb-wait-time ignored for a locally started YDB instance? With --ydb-host, _ydb_service does not start a container. Without it, this fixture falls back to service.get_service_settings(), which gets the timeout from TESTSUITE_YDB_WAIT_TIME instead of the CLI option.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something, or is --ydb-wait-time ignored for a locally started YDB instance? With --ydb-host, _ydb_service does not start a container. Without it, this fixture falls back to service.get_service_settings(), which gets the timeout from TESTSUITE_YDB_WAIT_TIME instead of the CLI option.

Fixed

break
fi

if [ "$i" -eq "$YDB_WAIT_TIME" ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fail one polling interval too early? For example, with YDB_WAIT_TIME=1, it checks once and exists before sleep 1. With the default value of 30, the final check happens after about 29 seconds rather than after the full timeout.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fail one polling interval too early? For example, with YDB_WAIT_TIME=1, it checks once and exists before sleep 1. With the default value of 30, the final check happens after about 29 seconds rather than after the full timeout.

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we run the readiness check again after the final sleep before calling die?

For example, with YDB_WAIT_TIME=1, the script currently checks at t=0, sleeps for one second, and then fails without checking at t=1.

The timeout should only be reported if that final readiness check also fails.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we run the readiness check again after the final sleep before calling die?

For example, with YDB_WAIT_TIME=1, the script currently checks at t=0, sleeps for one second, and then fails without checking at t=1.

The timeout should only be reported if that final readiness check also fails.

Done. I fixed the verification order.

@lemito
lemito requested a review from vasily-sviridov July 29, 2026 18:07
@Anton3 Anton3 changed the title Fix testsuite ydb plugin fix testsuite: fix YDB startup scripts Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants