aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorijon <ijon@yandex-team.com>2023-02-15 18:14:25 +0300
committerijon <ijon@yandex-team.com>2023-02-15 18:14:25 +0300
commitb9781d94e736c222c715163386a63bfe6dfbe4ff (patch)
treeffe7572c40d8296b792818906ea6c45a35bd0fa8
parentfb4ef51595c8a68be43a9a6bf05d6ebf9c3b8d5d (diff)
downloadydb-b9781d94e736c222c715163386a63bfe6dfbe4ff.tar.gz
ydb/core/testlib: fix double locals for dynamic nodes
Remove startup of 'local' services for the dynamic nodes in TServer initialization (these instances serve root subdomain). This should be done for static nodes only. Dynamic node are intended to be setup dynamically as part of tenant subdomain creation process which involve starting 'local' service exclusivly for serving that tenant subdomain. Two 'local' service instances for the single dynamic node (and serving different subdomains) is incorrect and unsupported configuration, resulting in unexpected flaky behaviour of tests.
-rw-r--r--ydb/core/testlib/test_client.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/ydb/core/testlib/test_client.cpp b/ydb/core/testlib/test_client.cpp
index 3a2150e5365..3b0e653b29c 100644
--- a/ydb/core/testlib/test_client.cpp
+++ b/ydb/core/testlib/test_client.cpp
@@ -237,8 +237,23 @@ namespace Tests {
// WARNING: must be careful about modifying app data after actor system starts
- for (ui32 nodeIdx = 0; nodeIdx < StaticNodes() + DynamicNodes(); ++nodeIdx) {
+ // NOTE: Setup of the static and dynamic nodes is mostly common except for the "local" service,
+ // which _must not_ be started up on dynamic nodes.
+ //
+ // This is because static nodes should be active and must serve root subdomain right from the start.
+ // Unlike static nodes, dynamic nodes are vacant. In this testing framework they are intended
+ // to serve tenant subdomains that will be created in tests. Dynamic node will be "activated" then
+ // by call to SetupDynamicLocalService() which will start "local" service exclusively to serve
+ // requested tenant subdomain.
+ //
+ // And while single "local" service is capable of serving more than one subdomain, there are never
+ // should be more than one "local" service on a node. Otherwise two "locals" will be competing
+ // and tests might have unexpected flaky behaviour.
+ //
+ for (ui32 nodeIdx = 0; nodeIdx < StaticNodes(); ++nodeIdx) {
SetupDomainLocalService(nodeIdx);
+ }
+ for (ui32 nodeIdx = 0; nodeIdx < StaticNodes() + DynamicNodes(); ++nodeIdx) {
SetupConfigurators(nodeIdx);
SetupProxies(nodeIdx);
}