Skip to content

Commit c71486c

Browse files
committed
More tests methods for transfer (#18400)
1 parent 3827426 commit c71486c

File tree

1 file changed

+19
-14
lines changed
  • ydb/tests/functional/replication

1 file changed

+19
-14
lines changed

ydb/tests/functional/replication/utils.h

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ struct MainTestCase {
172172
return config;
173173
}
174174

175-
MainTestCase(std::optional<std::string> user = std::nullopt)
176-
: Id(RandomNumber<size_t>())
175+
MainTestCase(const std::optional<std::string> user = std::nullopt, std::string tableType = "COLUMN")
176+
: TableType(std::move(tableType))
177+
, Id(RandomNumber<size_t>())
177178
, ConnectionString(GetEnv("YDB_ENDPOINT") + "/?database=" + GetEnv("YDB_DATABASE"))
178179
, TopicName(TStringBuilder() << "Topic_" << Id)
179180
, SourceTableName(TStringBuilder() << "SourceTable_" << Id)
@@ -256,7 +257,7 @@ struct MainTestCase {
256257
}
257258

258259
void CreateTable(const std::string& tableDDL) {
259-
ExecuteDDL(Sprintf(tableDDL.data(), TableName.data()));
260+
ExecuteDDL(Sprintf(tableDDL.data(), TableName.data(), TableType.data()));
260261
}
261262

262263
void DropTable() {
@@ -613,12 +614,14 @@ struct MainTestCase {
613614
}
614615
}
615616

616-
break;
617+
return;
617618
}
618619

619-
UNIT_ASSERT_C(attempt, "Unable to wait transfer result");
620620
Sleep(TDuration::Seconds(1));
621621
}
622+
623+
CheckTransferState(TReplicationDescription::EState::Running);
624+
UNIT_ASSERT_C(false, "Unable to wait transfer result");
622625
}
623626

624627
TReplicationDescription CheckTransferState(TReplicationDescription::EState expected) {
@@ -633,7 +636,8 @@ struct MainTestCase {
633636
issues = result.GetErrorState().GetIssues().ToOneLineString();
634637
}
635638

636-
UNIT_ASSERT_C(i, "Unable to wait transfer state. Expected: " << expected << ", actual: " << result.GetState() << ", " << issues); Sleep(TDuration::Seconds(1));
639+
UNIT_ASSERT_C(i, "Unable to wait transfer state. Expected: " << expected << ", actual: " << result.GetState() << ", " << issues);
640+
Sleep(TDuration::Seconds(1));
637641
}
638642

639643
Y_UNREACHABLE();
@@ -681,15 +685,16 @@ struct MainTestCase {
681685
DropTopic();
682686
}
683687

688+
const std::string TableType;
684689
const size_t Id;
685-
const TString ConnectionString;
686-
687-
const TString TopicName;
688-
const TString SourceTableName;
689-
const TString ChangefeedName;
690-
const TString TableName;
691-
const TString ReplicationName;
692-
const TString TransferName;
690+
const std::string ConnectionString;
691+
692+
const std::string TopicName;
693+
const std::string SourceTableName;
694+
const std::string ChangefeedName;
695+
const std::string TableName;
696+
const std::string ReplicationName;
697+
const std::string TransferName;
693698

694699
TDriver Driver;
695700
TQueryClient TableClient;

0 commit comments

Comments
 (0)