Skip to content

Commit

Permalink
[#24861] DocDB: Fix PgMiniTest.MoveMaster in TSAN
Browse files Browse the repository at this point in the history
Summary:
Use kTimeMultiplier when waiting for table creation in test.
Jira: DB-13981

Test Plan: ./yb_build.sh tsan PgMiniTest.MoveMaster -n 20

Reviewers: hsunder

Reviewed By: hsunder

Subscribers: ybase, yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D39876
  • Loading branch information
spolitov committed Nov 12, 2024
1 parent bfffc1f commit 378da05
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/yb/yql/pgwrapper/pg_mini-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

#include <gtest/gtest.h>

#include "yb/client/table_info.h"
#include "yb/client/yb_table_name.h"

#include "yb/common/common_flags.h"
#include "yb/common/pgsql_error.h"

Expand Down Expand Up @@ -1186,6 +1189,17 @@ TEST_F(PgMiniTest, BigSelect) {
}

TEST_F(PgMiniTest, MoveMaster) {
for (;;) {
client::YBTableName transactions_table_name(
YQL_DATABASE_CQL, master::kSystemNamespaceName, kGlobalTransactionsTableName);
auto result = client_->GetYBTableInfo(transactions_table_name);
if (result.ok()) {
LOG(INFO) << "Transactions table info: " << result->table_id;
break;
}
LOG(INFO) << "Waiting for transactions table";
std::this_thread::sleep_for(1s);
}
ShutdownAllMasters(cluster_.get());
cluster_->mini_master(0)->set_pass_master_addresses(false);
ASSERT_OK(StartAllMasters(cluster_.get()));
Expand All @@ -1196,7 +1210,7 @@ TEST_F(PgMiniTest, MoveMaster) {
auto status = conn.Execute("CREATE TABLE t (key INT PRIMARY KEY)");
WARN_NOT_OK(status, "Failed to create table");
return status.ok();
}, 15s, "Create table"));
}, 15s * kTimeMultiplier, "Create table"));
}

TEST_F(PgMiniTest, DDLWithRestart) {
Expand Down

0 comments on commit 378da05

Please sign in to comment.