Skip to content

Commit e366dce

Browse files
authored
test: wait a bit for PGAdapter to start (GoogleCloudPlatform#4064)
1 parent 8dd21f2 commit e366dce

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

samples/golang/pgx/pgx_sample.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"flag"
1919
"fmt"
2020
"os"
21+
"time"
2122

2223
pgadapter "github.com/GoogleCloudPlatform/pgadapter/wrappers/golang"
2324
"github.com/jackc/pgx/v5"
@@ -70,6 +71,7 @@ func runSample(project, instance, database string, emulator bool) (string, error
7071
fmt.Printf("failed to start PGAdapter: %v\n", err)
7172
return "", err
7273
}
74+
time.Sleep(time.Second)
7375
// Stop PGAdapter when this function returns.
7476
// This is not required, as the PGAdapter sub-process shuts down automatically when your
7577
// application shuts down. The PGAdapter sub-process is not guaranteed to shut down if

0 commit comments

Comments
 (0)