-
Notifications
You must be signed in to change notification settings - Fork 740
YQ-2670 switch generic tests to docker compose #691
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,19 +6,19 @@ | |
| namespace NTestUtils { | ||
|
|
||
| TString GetChHost() { | ||
| return GetEnv("RECIPE_CLICKHOUSE_HOST", "localhost"); | ||
| return "localhost"; | ||
| } | ||
|
|
||
| ui32 GetChPort() { | ||
| return FromString<ui32>(GetEnv("RECIPE_CLICKHOUSE_NATIVE_PORT", "1234")); | ||
| return 19000; | ||
| } | ||
|
|
||
| TString GetChUser() { | ||
| return GetEnv("RECIPE_CLICKHOUSE_USER"); | ||
| return "user"; | ||
| } | ||
|
|
||
| TString GetChPassword() { | ||
| return GetEnv("RECIPE_CLICKHOUSE_PASSWORD"); | ||
| return "password"; | ||
| } | ||
|
|
||
| TString GetChDatabase() { | ||
|
|
@@ -32,7 +32,20 @@ namespace NTestUtils { | |
| .SetPort(GetChPort()) | ||
| .SetUser(GetChUser()) | ||
| .SetPassword(GetChPassword()); | ||
| return NClickHouse::TClient(opt); | ||
|
|
||
| TInstant start = TInstant::Now(); | ||
| ui32 attempt = 0; | ||
| while ((TInstant::Now() - start).Seconds() < 60) { | ||
| attempt += 1; | ||
| try { | ||
| return NClickHouse::TClient(opt); | ||
| } catch (const TSystemError& e) { | ||
| Cerr << "Attempt " << attempt << ": " << e.what() << Endl; | ||
| Sleep(TDuration::MilliSeconds(100)); | ||
| } | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Я бы сказал, что для PG тоже нужны ретраи. Во всяком, случае, я наблюдаю такую же проблему в своих тестах на generic provider |
||
| throw yexception() << "Failed to connect ClickHouse in " << attempt << " attempt(s)"; | ||
| } | ||
|
|
||
| } // namespace NTestUtils | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| version: '3.4' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have a configured file here: https://github.com/ydb-platform/ydb/blob/main/ydb/library/yql/providers/generic/connector/tests/docker-compose.yml Let's make a reusable recipe from it and use it in both places The example of making a recipe: https://github.com/ydb-platform/ydb/tree/main/ydb/tests/tools/s3_recipe
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This |
||
| services: | ||
| postgresql: | ||
| image: postgres:15-bullseye@sha256:3411b9f2e5239cd7867f34fcf22fe964230f7d447a71d63c283e3593d3f84085 | ||
| environment: | ||
| POSTGRES_DB: db | ||
| POSTGRES_USER: user | ||
| POSTGRES_PASSWORD: password | ||
| ports: | ||
| - 15432:5432 | ||
| clickhouse: | ||
| image: clickhouse/clickhouse-server:23-alpine@sha256:b078c1cd294632afa2aeba3530e7ba2e568513da23304354f455a25fab575c06 | ||
| environment: | ||
| CLICKHOUSE_DB: db | ||
| CLICKHOUSE_USER: user | ||
| CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1 | ||
| CLICKHOUSE_PASSWORD: password | ||
| ports: | ||
| - 19000:9000 | ||
| - 18123:8123 | ||
| fq-connector-go: | ||
| image: ghcr.io/ydb-platform/fq-connector-go:v0.0.6-rc.8@sha256:74ebae0530d916c1842a7fddfbddc6c018763a0401f2f627a44e8829692fe41f | ||
| ports: | ||
| - 50051:50051 | ||
| network_mode: host | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the port is hardcoded? What will happen if several tests that use recipe will be started at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We intentionally disable local parallel runs (avoid
FORK_SUBTESTSand so on) of tests based ondocker-composerecipe because they look broken inya. For more details, see link in TG channel :)