Skip to content

Commit

Permalink
Fix nightly MySql data connection test (#24556)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fly-Style committed May 15, 2023
1 parent 77461f6 commit 4a03057
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void showDataConnectionsShouldReturnQuickly() throws Exception {
createTable("my_table");

final ToxiproxyClient toxiproxyClient = new ToxiproxyClient(toxiproxy.getHost(), toxiproxy.getControlPort());
final Proxy proxy = toxiproxyClient.createProxy("mysql", "0.0.0.0:8666", "mysql:3306");
final Proxy proxy = toxiproxyClient.createProxy("mysql", "0.0.0.0:8666", "mysql:3306");

String host = toxiproxy.getHost();
Integer port = toxiproxy.getMappedPort(8666);
Expand All @@ -88,15 +88,15 @@ public void showDataConnectionsShouldReturnQuickly() throws Exception {
ExecutorService executor = Executors.newSingleThreadExecutor();

SqlResult result = executor.submit(() -> sqlService.execute("SHOW DATA CONNECTIONS"))
.get(5, TimeUnit.SECONDS);
.get(5, TimeUnit.SECONDS);


assertThat(allRows(result)).containsExactly(
new Row("mysql", "Jdbc", jsonArray("Table")),
new Row("mysql", "jdbc", jsonArray("Table")),
new Row("testDatabaseRef", "jdbc", jsonArray("Table")));

result = executor.submit(() -> sqlService.execute("SHOW MAPPINGS"))
.get(5, TimeUnit.SECONDS);
.get(5, TimeUnit.SECONDS);

assertThat(allRows(result)).containsExactly(new Row("my_table"));
}
Expand Down

0 comments on commit 4a03057

Please sign in to comment.