Skip to content

Commit 13d36eb

Browse files
authored
update port for jdbc test (#38485)
* increase timeout switch to minute :) * check post commit * try adding back nat for one test case * try getting port instead * revert time change
1 parent bd52fce commit 13d36eb

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"modification": 5
2+
"modification": 1
33
}

sdks/go/test/integration/io/xlang/jdbc/jdbc_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/apache/beam/sdks/v2/go/test/integration/internal/containers"
3333
_ "github.com/go-sql-driver/mysql"
3434
_ "github.com/lib/pq"
35+
"strings"
3536
"github.com/testcontainers/testcontainers-go/wait"
3637
)
3738

@@ -60,7 +61,8 @@ func setupTestContainer(ctx context.Context, t *testing.T, dbname, username, pas
6061
hostname := "localhost"
6162

6263
dbURL := func(host string, port string) string {
63-
return fmt.Sprintf("postgres://%s:%s@%s:%s/%s?sslmode=disable", username, password, host, port, dbname)
64+
cleanPort := strings.Split(port, "/")[0]
65+
return fmt.Sprintf("postgres://%s:%s@%s:%s/%s?sslmode=disable", username, password, host, cleanPort, dbname)
6466
}
6567
waitStrategy := wait.ForSQL(postgresPort, "postgres", dbURL).WithStartupTimeout(time.Second * 5)
6668

0 commit comments

Comments
 (0)