Skip to content

Commit d174464

Browse files
authored
Fetch size load tests (#3496)
* added fetch Size load test with failure intention * minor * num partitions = 1 * updated spec path * updated spec path * fetchsize 0 * fetch size null ' * revert other tests * spotless * revert * update bug * added missing import
1 parent 244e7e6 commit d174464

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright (C) 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.google.cloud.teleport.v2.templates.loadtesting;
17+
18+
import com.google.cloud.teleport.metadata.TemplateLoadTest;
19+
import com.google.cloud.teleport.v2.source.reader.io.jdbc.iowrapper.config.SQLDialect;
20+
import com.google.cloud.teleport.v2.templates.SourceDbToSpanner;
21+
import java.util.HashMap;
22+
import java.util.Map;
23+
import org.junit.Ignore;
24+
import org.junit.Test;
25+
import org.junit.experimental.categories.Category;
26+
import org.junit.runner.RunWith;
27+
import org.junit.runners.JUnit4;
28+
29+
@Category(TemplateLoadTest.class)
30+
@TemplateLoadTest(SourceDbToSpanner.class)
31+
@RunWith(JUnit4.class)
32+
@Ignore("Waiting Dataflow release b/492536316")
33+
public class MySQLSourceDbtoSpannerWideRow50KBFetchSizeLT extends SourceDbToSpannerLTBase {
34+
private static final String WORKER_MACHINE_TYPE = "n2-standard-4";
35+
private static final String LAUNCHER_MACHINE_TYPE = "n2-standard-4";
36+
37+
@Test
38+
public void mySQLToSpannerWideRow50KBFetchSizeTest() throws Exception {
39+
40+
String username =
41+
accessSecret("projects/269744978479/secrets/wide-row-50kb-username/versions/1");
42+
String password =
43+
accessSecret("projects/269744978479/secrets/wide-row-50kb-password/versions/1");
44+
String database = "50KBRow";
45+
String host = accessSecret("projects/269744978479/secrets/wide-row-50kb-host/versions/1");
46+
int port = 3306;
47+
48+
setUp(SQLDialect.MYSQL, host, port, username, password, database);
49+
createSpannerDDL("SourceDbToSpannerLT/WideRow/spanner-schema-50kb-row.sql");
50+
51+
Map<String, Integer> expectedCountPerTable =
52+
new HashMap<>() {
53+
{
54+
put("heavy_users", 1000000);
55+
}
56+
};
57+
58+
Map<String, String> params =
59+
new HashMap<>() {
60+
{
61+
put("workerMachineType", WORKER_MACHINE_TYPE);
62+
put("numPartitions", "1");
63+
}
64+
};
65+
66+
Map<String, String> env =
67+
new HashMap<>() {
68+
{
69+
put("launcherMachineType", LAUNCHER_MACHINE_TYPE);
70+
}
71+
};
72+
runLoadTest(expectedCountPerTable, params, env);
73+
}
74+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE TABLE IF NOT EXISTS heavy_users (
2+
id INT64 NOT NULL,
3+
uuid STRING(36),
4+
full_name STRING(100),
5+
email STRING(100),
6+
country STRING(100),
7+
payload_1 STRING(MAX),
8+
payload_2 STRING(MAX),
9+
payload_3 STRING(MAX),
10+
payload_4 STRING(MAX),
11+
payload_5 STRING(MAX)
12+
) PRIMARY KEY (id);

0 commit comments

Comments
 (0)