Skip to content

Commit

Permalink
fix test failures for TestChangeReplicationPathIfReplicaExists
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Nov 2, 2024
1 parent 4a1b23d commit 1d08d2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,18 @@ func TestChangeReplicationPathIfReplicaExists(t *testing.T) {
r.Equal(expectedRows, rows)

engineFull := ""
if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "19.17") < 0 {
expectedEngine = strings.NewReplacer("{database}", "default", "{table}", table).Replace(expectedEngine)
}
r.NoError(env.ch.SelectSingleRowNoCtx(&engineFull, "SELECT engine_full FROM system.tables WHERE database=? AND name=?", "default", table))
r.Contains(engineFull, expectedEngine)

}
checkRestoredTable("test_replica_wrong_path", 10, "/clickhouse/tables/{cluster}/{shard}/default/test_replica_wrong_path")
expectedEngine := "/clickhouse/tables/{cluster}/{shard}/{database}/{table}"
checkRestoredTable("test_replica_wrong_path", 10, expectedEngine)

if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "20.7") >= 0 {
checkRestoredTable("test_replica_wrong_path_uuid", 10, "/clickhouse/tables/{cluster}/{shard}/default/test_replica_wrong_path_uuid")
checkRestoredTable("test_replica_wrong_path_uuid", 10, expectedEngine)
}

r.NoError(env.ch.DropTable(clickhouse.Table{Database: "default", Name: "test_replica_wrong_path"}, createSQL, "", false, version, ""))
Expand Down

0 comments on commit 1d08d2d

Please sign in to comment.